ShaHmac256Signer.php 346B

1234567891011121314151617181920
  1. <?php
  2. namespace Aliyun\Core\Auth;
  3. class ShaHmac256Signer implements ISigner
  4. {
  5. public function signString($source, $accessSecret)
  6. {
  7. return base64_encode(hash_hmac('sha256', $source, $accessSecret, true));
  8. }
  9. public function getSignatureMethod() {
  10. return "HMAC-SHA256";
  11. }
  12. public function getSignatureVersion() {
  13. return "1.0";
  14. }
  15. }