Пример #1
0
        public void sign()
        {
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign1");
            AwsCredentials credentials = this.sig_v4_ctx.Credentials_provider().get_credentials();

            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign2");
            this.akid = credentials.Akid();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign3");
            this.secret_key = credentials.Secret_key();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign4");
            if (string.IsNullOrEmpty(credentials.Session_token()))
            {
                this.req.headers().Add("x-amz-security-token", credentials.Session_token());
            }
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign5");
            this.req.headers().Remove("authorization");
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign6");
            this.calculate_canon_query_args();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign7");
            this.calculate_headers();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign8");
            this.calculate_canon_headers();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign9");
            this.calculate_signed_headers();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign10");
            this.calculate_credential_scope();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign11");
            this.calculate_canon_request();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign12");
            this.calculate_str_to_sign();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign13");
            this.calculate_auth_header();
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign14");
            this.req.headers().Add("Authorization", this.auth_header);
            StdErrorOut.Instance.StdOut(LogLevel.debug, "sign15");
        }
Пример #2
0
 bool verify_credentials_format(AwsCredentials creds)
 {
     return(kAkidRegex.Match(creds.Akid()).Success&& kSkRegex.Match(creds.Secret_key()).Success);
 }