Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
signaturemanager.php
1<?php
3
4
6
8{
12 protected $signer;
13
14 public function __construct()
15 {
16 }
17
18 public function getSignature($data)
19 {
20 return $this->getSigner()->getSignature($data, $this->getSignatureSalt());
21 }
22
23 public function validateSignature($data, $signature)
24 {
25 return $this->getSigner()->validate(
26 $data,
27 $signature,
28 $this->getSignatureSalt()
29 );
30 }
31
35 public function getSigner()
36 {
37 if(!$this->signer)
38 {
39 $this->setDefaultSigner();
40 }
41
42 return $this->signer;
43 }
44
48 public function setSigner(Signer $signer)
49 {
50 $this->signer = $signer;
51 }
52
53 protected function setDefaultSigner()
54 {
55 $this->setSigner(new Signer());
56 }
57
58 protected function getSignatureSalt()
59 {
60 return bitrix_sessid();
61 }
62}