Last active
August 29, 2015 14:16
-
-
Save mosufy/c59dd19b0b51fb336a0e to your computer and use it in GitHub Desktop.
VBC API Callback Signature Verification PHP Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$http_date = $_SERVER['HTTP_Date']; | |
$http_nonce = $_SERVER['HTTP_X_VBC_NONCE']; | |
$secret_key = '16c164004dd77d6ac1967dc6d0ca128cd5cd7afd77503779de173efee7e3b2e8'; // Your API Secret Key | |
$http_signature = $_SERVER['HTTP_X_VBC_REQUEST_SIGNATURE']; | |
$signature_construct = hash_hmac("sha256", $http_date . $http_nonce, $secret_key); | |
if ($http_signature != $signature_construct) { | |
echo 'Signature did not match! The authenticity of the originator of this callback could not be verified'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment