ApaiIO\Request\Util::buildSignature PHP Method

buildSignature() public static method

Provides the signature
public static buildSignature ( string $stringToSign, string $secretKey ) : string
$stringToSign string The string to be signed
$secretKey string The paapi secret key
return string
    public static function buildSignature($stringToSign, $secretKey)
    {
        return base64_encode(hash_hmac("sha256", $stringToSign, $secretKey, true));
    }

Usage Example

Example #1
0
 public function testSignature()
 {
     $expectedResult = "9hUgcq4Tnuwb9naeMAyL/Xnk070qcbQUfSbWsFBztgM=";
     $this->assertEquals($expectedResult, Util::buildSignature('ABCD', 'EFG'));
 }
All Usage Examples Of ApaiIO\Request\Util::buildSignature