Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
bitrix24signer.php
1
<?
2
namespace
Bitrix\Socialservices
;
3
4
use
Bitrix\Main\Web\Json
;
5
use
Bitrix\Main\Security\Sign\Signer
;
6
use
Bitrix\Main\Security\Sign\HmacAlgorithm
;
7
8
class
Bitrix24Signer
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
}
Bitrix\Main\Security\Sign\HmacAlgorithm
Definition
hmacalgorithm.php:14
Bitrix\Main\Security\Sign\Signer
Definition
signer.php:13
Bitrix\Main\Web\Json
Definition
json.php:11
Bitrix\Socialservices\Bitrix24Signer
Definition
bitrix24signer.php:10
Bitrix\Socialservices\Bitrix24Signer\encodeSignature
encodeSignature($value)
Definition
bitrix24signer.php:34
Bitrix\Socialservices\Bitrix24Signer\__construct
__construct()
Definition
bitrix24signer.php:11
Bitrix\Socialservices\Bitrix24Signer\sign
sign($value, $salt=null)
Definition
bitrix24signer.php:16
Bitrix\Socialservices\Bitrix24Signer\unsign
unsign($signedValue, $salt=null)
Definition
bitrix24signer.php:22
Bitrix\Socialservices\Bitrix24Signer\decodeSignature
decodeSignature($value)
Definition
bitrix24signer.php:45
Bitrix\Socialservices
Definition
ap.php:2
modules
socialservices
lib
bitrix24signer.php
Создано системой
1.10.0