Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6252681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:50:54+00:00 2026-05-24T13:50:54+00:00

I am having trouble signing my policy documents for the Amazon S3. There are

  • 0

I am having trouble signing my policy documents for the Amazon S3.

There are examples on how to do it in Ruby, Java, and Python, but when I try to do it in C#, it’s not working out. I keep getting an invalid signature, and I’m not sure where I’m going wrong.
http://aws.amazon.com/articles/1434

Can anyone provide an example like those in the article, except for C#?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:50:55+00:00Added an answer on May 24, 2026 at 1:50 pm

    Solved it for anyone else who runs into the same problem.

    class Program
    {
        static string secretKey = "Removed";
    
        static void Main(string[] args)
        {
            string policyStr = @"{""expiration"": ""2012-01-01T12:00:00.000Z"",""conditions"": [{""bucket"": ""<bucket>"" },{""acl"": ""public-read"" },[""eq"", ""$key"", ""<filename>""],[""starts-with"", ""$Content-Type"", ""image/""],]}";
    
            GetSig(policyStr);
        }
    
        static void GetSig(string policyStr)
        {
            string b64Policy = Convert.ToBase64String(Encoding.ASCII.GetBytes(policyStr));
    
            byte[] b64Key = Encoding.ASCII.GetBytes(secretKey);
            HMACSHA1 hmacSha1 = new HMACSHA1(b64Key);
            Console.WriteLine(policyStr);
            Console.WriteLine(b64Policy);
            Console.WriteLine();
            Console.WriteLine(
                Convert.ToBase64String(hmacSha1.ComputeHash(Encoding.ASCII.GetBytes(b64Policy))));
    
            Console.ReadKey();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having trouble with this -- a couple of other related posts out there, but
I am having real trouble with provisioning and code signing issues. I have migrated
Having trouble with each function... Will try to explain by example... In my code,
Having trouble with an .htaccess file on WAMP. Works on the live server, but
I'm a beginner to rails and I'm having trouble with signing users in when
I'm having trouble overriding the Code Signing Identity and provisioning profile that are specified
All, I am having some trouble running a java web start application that has
I'm having trouble doing the following in Java. Below is the Fantom code from
Having trouble with this..I'm sure I'm missing something simple but I simply want the
Having trouble with the examples for the .RowStart method. Comparing the 2 syntaxes: http://www.jeremyskinner.co.uk/2009/03/01/mvccontrib-grid-part-5-the-action-syntax/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.