diff --git a/main/mashape/http/AuthUtil.php b/main/mashape/http/AuthUtil.php new file mode 100644 index 0000000..646ab37 --- /dev/null +++ b/main/mashape/http/AuthUtil.php @@ -0,0 +1,38 @@ +. + * + * + * The author of this software is Mashape, Inc. + * For any question or feedback please contact us at: support@mashape.com + * + */ + +class AuthUtil { + + public static function generateAuthenticationHeader($publicKey, $privateKey) { + $uuid = uniqid(); + $hash = hash_hmac("sha1", $uuid, $privateKey); + $header = "X-Mashape-Authorization: " . base64_encode($publicKey . ":" . $hash . $uuid) . "\r\n"; + return $header; + } + +} + +?>