From 21b7d4b6307b113ad3fc2871c0b2693a9f1fc3f9 Mon Sep 17 00:00:00 2001 From: teunlielu Date: Fri, 23 Sep 2022 12:41:37 +0200 Subject: [PATCH] Update Signature.php Support for HMAC-SHA256 --- src/OAuth/OAuth1/Signature/Signature.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/OAuth/OAuth1/Signature/Signature.php b/src/OAuth/OAuth1/Signature/Signature.php index 23711d31..74463647 100644 --- a/src/OAuth/OAuth1/Signature/Signature.php +++ b/src/OAuth/OAuth1/Signature/Signature.php @@ -114,6 +114,8 @@ protected function hash($data) switch (strtoupper($this->algorithm)) { case 'HMAC-SHA1': return hash_hmac('sha1', $data, $this->getSigningKey(), true); + case 'HMAC-SHA256': + return hash_hmac('sha256', $data, $this->getSigningKey(), true); default: throw new UnsupportedHashAlgorithmException( 'Unsupported hashing algorithm (' . $this->algorithm . ') used.'