Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
bitrix24signer.php
1<?
3
7
9 extends Signer
10{
11 public function __construct()
12 {
13 parent::__construct(new HmacAlgorithm('sha256'));
14 }
15
16 public function sign($value, $salt = null)
17 {
18 $valueEnc = base64_encode(Json::encode($value));
19 return parent::sign($valueEnc, $salt);
20 }
21
22 public function unsign($signedValue, $salt = null)
23 {
24 $encodedValue = parent::unsign($signedValue, $salt);
25 return Json::decode(base64_decode($encodedValue));
26 }
27
34 protected function encodeSignature($value)
35 {
36 return base64_encode($value);
37 }
38
45 protected function decodeSignature($value)
46 {
47 return base64_decode($value);
48 }
49}
unsign($signedValue, $salt=null)