Amazon.Runtime.Internal.Auth.AWS4Signer.ComposeSigningKey C# (CSharp) 메소드

ComposeSigningKey() 공개 정적인 메소드

Compute and return the multi-stage signing key for the request.
public static ComposeSigningKey ( string awsSecretAccessKey, string region, string date, string service ) : byte[]
awsSecretAccessKey string The clear-text AWS secret key, if not held in secureKey
region string The region in which the service request will be processed
date string Date of the request, in yyyyMMdd format
service string The name of the service being called by the request
리턴 byte[]
        public static byte[] ComposeSigningKey(string awsSecretAccessKey, string region, string date, string service)
        {
            char[] ksecret = null;

            try
            {
                ksecret = (Scheme + awsSecretAccessKey).ToCharArray();

                var hashDate = ComputeKeyedHash(SignerAlgorithm, Encoding.UTF8.GetBytes(ksecret), Encoding.UTF8.GetBytes(date));
                var hashRegion = ComputeKeyedHash(SignerAlgorithm, hashDate, Encoding.UTF8.GetBytes(region));
                var hashService = ComputeKeyedHash(SignerAlgorithm, hashRegion, Encoding.UTF8.GetBytes(service));
                return ComputeKeyedHash(SignerAlgorithm, hashService, TerminatorBytes);
            }
            finally
            {
                // clean up all secrets, regardless of how initially seeded (for simplicity)
                if (ksecret != null)
                    Array.Clear(ksecret, 0, ksecret.Length);
            }
        }