Recently in the study of cloud storage. If there is no relevant background knowledge of friends, please first Baidu.
The first thing I would like to say is the signature algorithm error problem, may be their website content error, please check.
As follows.
Http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-authentication-HTTPPOST.html
The sample website is as follows:
Http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html
I use the three-way online encryption site, the password calculated is not the same as Amazon.
I wrote a small program, calculated with the three sides is the same. I don't know what Amazon's signature is? Guidance.
The source code is as follows:
1String key ="Wjalrxutnfemi/k7mdeng/bpxrficyexamplekey";2 using(varAlgorithm = Keyedhashalgorithm.create ("HMACSHA256"))3 {4Algorithm. Key =Encoding.UTF8.GetBytes (key);5 stringdata ="eyaizxhwaxjhdglvbii6iciymdezlta4lta3vdeyojawojawljawmfoila0kicaiy29uzgl0aw9ucyi6ifsnciagicb7imj1y2tldci6icjlegftcgxly nvja2v0in0sdqogicagwyjzdgfydhmtd2l0acisicika2v5iiwginvzzxivdxnlcjevil0sdqogicageyjhy2wioiaichvibgljlxjlywqifswnciagicb7in N1y2nlc3nfywn0aw9ux3jlzglyzwn0ijogimh0dha6ly9legftcgxlynvja2v0lnmzlmftyxpvbmf3cy5jb20vc3vjy2vzc2z1bf91cgxvywquahrtbcj9la0 Kicagifsic3rhcnrzlxdpdggilcaijenvbnrlbnqtvhlwzsisicjpbwfnzs8ixswnciagicb7ingtyw16lw1ldgetdxvpzci6icixndm2nteymzy1mti3ncj9 La0kicagifsic3rhcnrzlxdpdggilcaijhgtyw16lw1ldgetdgfniiwgiijdla0kdqogicageyj4lwftei1jcmvkzw50awfsijogikflsufjt1ngt0rotjdfw Efnuexflziwmtmwoda2l3vzlwvhc3qtms9zmy9hd3m0x3jlcxvlc3qifswnciagicb7ingtyw16lwfsz29yaxrobsi6icjbv1m0luhnqumtu0hbmju2in0sdq ogicageyj4lwftei1kyxrlijogijiwmtmwoda2vdawmdawmfoiih0nciagxq0kfq==";6 byte[] Key2 =Algorithm.computehash (Encoding.UTF8.GetBytes (data));7 stringShow = Bitconverter.tostring (Key2). Replace ("-",""). Tolowerinvariant ();8 MessageBox.Show (Show);9}
View Code
Amazon Cloud storage Signature Algorithm problem