예제 #1
0
 /**
  * @return string
  */
 public function generateSignature()
 {
     $dateKey = hash_hmac('sha256', $this->credential->getDate(), 'AWS4' . $this->secret, true);
     $dateRegionKey = hash_hmac('sha256', $this->credential->getRegion(), $dateKey, true);
     $dateRegionServiceKey = hash_hmac('sha256', $this->credential->getService(), $dateRegionKey, true);
     $signingKey = hash_hmac('sha256', $this->credential->getRequestType(), $dateRegionServiceKey, true);
     $signature = hash_hmac('sha256', $this->getBase64EncodedPolicy(), $signingKey);
     return $signature;
 }