\WePayV3\ContractsDecryptAes

Aes 解密工具类 Class DecryptAes

Summary

Methods
Properties
Constants
__construct()
decryptToString()
No public properties found
KEY_LENGTH_BYTE
AUTH_TAG_LENGTH_BYTE
No protected methods found
No protected properties found
N/A
No private methods found
$aesKey
N/A

Constants

KEY_LENGTH_BYTE

KEY_LENGTH_BYTE = 32

AUTH_TAG_LENGTH_BYTE

AUTH_TAG_LENGTH_BYTE = 16

Properties

$aesKey

$aesKey : 

Type

Methods

__construct()

__construct(string  $aesKey) 

Constructor

Parameters

string $aesKey

decryptToString()

decryptToString(string  $associatedData, string  $nonceStr, string  $ciphertext) : string|boolean

Decrypt AEAD_AES_256_GCM ciphertext

Parameters

string $associatedData

AES GCM additional authentication data

string $nonceStr

AES GCM nonce

string $ciphertext

AES GCM cipher text

Throws

\WeChat\Exceptions\InvalidDecryptException

Returns

string|boolean —

Decrypted string on success or FALSE on failure