Amazon Cloud storage Signature Algorithm problem

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.