Last active
December 17, 2015 04:19
-
-
Save tanglebones/5549882 to your computer and use it in GitHub Desktop.
Computing the signature for an s3 policy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static string ComputeSignature(string policyEncoded, string privateKey) | |
{ | |
using (var hmac = new HMACSHA1(Encoding.UTF8.GetBytes(privateKey), true)) | |
{ | |
return Convert.ToBase64String(hmac.ComputeHash(Encoding.UTF8.GetBytes(policyEncoded))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment