Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mosufy/c59dd19b0b51fb336a0e to your computer and use it in GitHub Desktop.
Save mosufy/c59dd19b0b51fb336a0e to your computer and use it in GitHub Desktop.
VBC API Callback Signature Verification PHP Example
<?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