function testHexDigestSha1_again() { $key = str_repeat(chr(0xaa), 80); $message = 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data'; $d = Braintree_Digest::hexDigestSha1($key, $message); $this->assertEquals('e8e99d0f45237d786d6bbaa7965c7808bbff1a91', $d); }
private static function _payloadMatches($signature, $payload) { $payloadSignature = Braintree_Digest::hexDigestSha1(Braintree_Configuration::privateKey(), $payload); return Braintree_Digest::secureCompare($signature, $payloadSignature); }
public static function sampleNotification($kind, $id) { $payload = base64_encode(self::_sampleXml($kind, $id)) . "\n"; $signature = Braintree_Configuration::publicKey() . "|" . Braintree_Digest::hexDigestSha1(Braintree_Configuration::privateKey(), $payload); return array('signature' => $signature, 'payload' => $payload); }
/** * @ignore */ private function _hash($string) { return Braintree_Digest::hexDigestSha1($this->_config->privateKey(), $string); }
/** * @ignore */ private static function _hash($string) { return Braintree_Digest::hexDigestSha1(Braintree_Configuration::privateKey(), $string); }