C# 클래스 Amazon.Runtime.Internal.Auth.AWS4Signer

상속: AbstractAWSSigner
파일 보기 프로젝트 열기: aws/aws-sdk-net 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
TerminatorBytes byte[]

공개 메소드들

메소드 설명
ComposeSigningKey ( string awsSecretAccessKey, string region, string date, string service ) : byte[]

Compute and return the multi-stage signing key for the request.

ComputeHash ( byte data ) : byte[]

Computes the non-keyed hash of the supplied data

ComputeHash ( string data ) : byte[]

Computes the non-keyed hash of the supplied data

ComputeKeyedHash ( SigningAlgorithm algorithm, byte key, byte data ) : byte[]

Compute and return the hash of a data blob using the specified key

ComputeKeyedHash ( SigningAlgorithm algorithm, byte key, string data ) : byte[]

Compute and return the hash of a data blob using the specified key

ComputeSignature ( ImmutableCredentials credentials, string region, System.DateTime signedAt, string service, string signedHeaders, string canonicalRequest ) : AWS4SigningResult

Computes and returns an AWS4 signature for the specified canonicalized request

ComputeSignature ( string awsAccessKey, string awsSecretAccessKey, string region, System.DateTime signedAt, string service, string signedHeaders, string canonicalRequest ) : AWS4SigningResult

Computes and returns an AWS4 signature for the specified canonicalized request

ComputeSignature ( string awsAccessKey, string awsSecretAccessKey, string region, System.DateTime signedAt, string service, string signedHeaders, string canonicalRequest, RequestMetrics metrics ) : AWS4SigningResult

Computes and returns an AWS4 signature for the specified canonicalized request

DetermineSigningRegion ( IClientConfig clientConfig, string serviceName, RegionEndpoint alternateEndpoint, IRequest request ) : string
FormatDateTime ( System.DateTime dt, string formatString ) : string

Formats the supplied date and time for use in AWS4 signing, where various formats are used.

InitializeHeaders ( string>.IDictionary headers, Uri requestEndpoint ) : System.DateTime

Sets the AWS4 mandated 'host' and 'x-amz-date' headers, returning the date/time that will be used throughout the signing process in various elements and formats.

InitializeHeaders ( string>.IDictionary headers, Uri requestEndpoint, System.DateTime requestDateTime ) : System.DateTime

Sets the AWS4 mandated 'host' and 'x-amz-date' headers, accepting and returning the date/time that will be used throughout the signing process in various elements and formats.

SetRequestBodyHash ( IRequest request ) : string

If the caller has already set the x-amz-content-sha256 header with a pre-computed content hash, or it is present as ContentStreamHash on the request instance, return the value to be used in request canonicalization. If not set as a header or in the request, attempt to compute a hash based on inspection of the style of the request content.

Sign ( IRequest request, IClientConfig clientConfig, RequestMetrics metrics, string awsAccessKeyId, string awsSecretAccessKey ) : void

Calculates and signs the specified request using the AWS4 signing protocol by using the AWS account credentials given in the method parameters. The resulting signature is added to the request headers as 'Authorization'. Parameters supplied in the request, either in the resource path as a query string or in the Parameters collection must not have been uri encoded. If they have, use the SignRequest method to obtain a signature.

SignBlob ( byte key, byte data ) : byte[]

Returns the HMAC256 for an arbitrary blob using the specified key

SignBlob ( byte key, string data ) : byte[]

Returns the HMAC256 for an arbitrary blob using the specified key

SignRequest ( IRequest request, IClientConfig clientConfig, RequestMetrics metrics, string awsAccessKeyId, string awsSecretAccessKey ) : AWS4SigningResult

Calculates and signs the specified request using the AWS4 signing protocol by using the AWS account credentials given in the method parameters.

Parameters passed as part of the resource path should be uri-encoded prior to entry to the signer. Parameters passed in the request.Parameters collection should be not be encoded; encoding will be done for these parameters as part of the construction of the canonical request.

보호된 메소드들

메소드 설명
CanonicalizeHeaderNames ( string>.IEnumerable sortedHeaders ) : string

Returns the set of headers included in the signature as a flattened, ;-delimited string

CanonicalizeHeaders ( string>.IEnumerable sortedHeaders ) : string

Computes the canonical headers with values for the request. Only headers included in the signature are included in the canonicalization process.

CanonicalizeQueryParameters ( string>.IDictionary parameters ) : string
CanonicalizeQueryParameters ( string>.IDictionary parameters, bool uriEncodeParameters ) : string

Computes and returns the canonicalized query string, if query parameters have been supplied. Parameters with no value will be canonicalized as 'param='. The expectation is that parameters have not already been url encoded prior to canonicalization.

CanonicalizeQueryParameters ( string queryString ) : string
CanonicalizeQueryParameters ( string queryString, bool uriEncodeParameters ) : string

Computes and returns the canonicalized query string, if query parameters have been supplied. Parameters with no value will be canonicalized as 'param='. The expectation is that parameters have not already been url encoded prior to canonicalization.

CanonicalizeRequest ( Uri endpoint, string resourcePath, string httpMethod, string>.IDictionary sortedHeaders, string canonicalQueryString, string precomputedBodyHash ) : string

Computes and returns the canonical request

GetParametersToCanonicalize ( IRequest request ) : string>.IDictionary

Collects the subresource and query string parameters into one collection ready for canonicalization

SortAndPruneHeaders ( string>.IEnumerable requestHeaders ) : string>.IDictionary

Reorders the headers for the request for canonicalization.

For AWS4 signing, all headers are considered viable for inclusion

비공개 메소드들

메소드 설명
CleanHeaders ( string>.IDictionary headers ) : void
CompressSpaces ( string data ) : string
DetermineService ( IClientConfig clientConfig ) : string
GetRequestPayloadBytes ( IRequest request ) : byte[]

Returns the request parameters in the form of a query string.

메소드 상세

CanonicalizeHeaderNames() 보호된 정적인 메소드

Returns the set of headers included in the signature as a flattened, ;-delimited string
protected static CanonicalizeHeaderNames ( string>.IEnumerable sortedHeaders ) : string
sortedHeaders string>.IEnumerable The headers included in the signature
리턴 string

CanonicalizeHeaders() 보호된 정적인 메소드

Computes the canonical headers with values for the request. Only headers included in the signature are included in the canonicalization process.
protected static CanonicalizeHeaders ( string>.IEnumerable sortedHeaders ) : string
sortedHeaders string>.IEnumerable All request headers, sorted into canonical order
리턴 string

CanonicalizeQueryParameters() 보호된 정적인 메소드

protected static CanonicalizeQueryParameters ( string>.IDictionary parameters ) : string
parameters string>.IDictionary
리턴 string

CanonicalizeQueryParameters() 보호된 정적인 메소드

Computes and returns the canonicalized query string, if query parameters have been supplied. Parameters with no value will be canonicalized as 'param='. The expectation is that parameters have not already been url encoded prior to canonicalization.
protected static CanonicalizeQueryParameters ( string>.IDictionary parameters, bool uriEncodeParameters ) : string
parameters string>.IDictionary The set of parameters to be encoded in the query string
uriEncodeParameters bool /// Parameters must be uri encoded into the canonical request and by default the signer expects /// that the supplied collection contains non-encoded data. Set this to false if the encoding was /// done prior to signer entry. ///
리턴 string

CanonicalizeQueryParameters() 보호된 정적인 메소드

protected static CanonicalizeQueryParameters ( string queryString ) : string
queryString string
리턴 string

CanonicalizeQueryParameters() 보호된 정적인 메소드

Computes and returns the canonicalized query string, if query parameters have been supplied. Parameters with no value will be canonicalized as 'param='. The expectation is that parameters have not already been url encoded prior to canonicalization.
protected static CanonicalizeQueryParameters ( string queryString, bool uriEncodeParameters ) : string
queryString string The set of parameters being passed on the uri
uriEncodeParameters bool /// Parameters must be uri encoded into the canonical request and by default the signer expects /// that the supplied collection contains non-encoded data. Set this to false if the encoding was /// done prior to signer entry. ///
리턴 string

CanonicalizeRequest() 보호된 정적인 메소드

Computes and returns the canonical request
protected static CanonicalizeRequest ( Uri endpoint, string resourcePath, string httpMethod, string>.IDictionary sortedHeaders, string canonicalQueryString, string precomputedBodyHash ) : string
endpoint System.Uri The endpoint URL
resourcePath string the path of the resource being operated on
httpMethod string The http method used for the request
sortedHeaders string>.IDictionary The full request headers, sorted into canonical order
canonicalQueryString string The query parameters for the request
precomputedBodyHash string /// The hash of the binary request body if present. If not supplied, the routine /// will look for the hash as a header on the request. ///
리턴 string

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[]

ComputeHash() 공개 정적인 메소드

Computes the non-keyed hash of the supplied data
public static ComputeHash ( byte data ) : byte[]
data byte
리턴 byte[]

ComputeHash() 공개 정적인 메소드

Computes the non-keyed hash of the supplied data
public static ComputeHash ( string data ) : byte[]
data string
리턴 byte[]

ComputeKeyedHash() 공개 정적인 메소드

Compute and return the hash of a data blob using the specified key
public static ComputeKeyedHash ( SigningAlgorithm algorithm, byte key, byte data ) : byte[]
algorithm SigningAlgorithm Algorithm to use for hashing
key byte Hash key
data byte Data blob
리턴 byte[]

ComputeKeyedHash() 공개 정적인 메소드

Compute and return the hash of a data blob using the specified key
public static ComputeKeyedHash ( SigningAlgorithm algorithm, byte key, string data ) : byte[]
algorithm SigningAlgorithm Algorithm to use for hashing
key byte Hash key
data string Data blob
리턴 byte[]

ComputeSignature() 공개 정적인 메소드

Computes and returns an AWS4 signature for the specified canonicalized request
public static ComputeSignature ( ImmutableCredentials credentials, string region, System.DateTime signedAt, string service, string signedHeaders, string canonicalRequest ) : AWS4SigningResult
credentials Amazon.Runtime.ImmutableCredentials
region string
signedAt System.DateTime
service string
signedHeaders string
canonicalRequest string
리턴 AWS4SigningResult

ComputeSignature() 공개 정적인 메소드

Computes and returns an AWS4 signature for the specified canonicalized request
public static ComputeSignature ( string awsAccessKey, string awsSecretAccessKey, string region, System.DateTime signedAt, string service, string signedHeaders, string canonicalRequest ) : AWS4SigningResult
awsAccessKey string
awsSecretAccessKey string
region string
signedAt System.DateTime
service string
signedHeaders string
canonicalRequest string
리턴 AWS4SigningResult

ComputeSignature() 공개 정적인 메소드

Computes and returns an AWS4 signature for the specified canonicalized request
public static ComputeSignature ( string awsAccessKey, string awsSecretAccessKey, string region, System.DateTime signedAt, string service, string signedHeaders, string canonicalRequest, RequestMetrics metrics ) : AWS4SigningResult
awsAccessKey string
awsSecretAccessKey string
region string
signedAt System.DateTime
service string
signedHeaders string
canonicalRequest string
metrics Amazon.Runtime.Internal.Util.RequestMetrics
리턴 AWS4SigningResult

DetermineSigningRegion() 공개 정적인 메소드

public static DetermineSigningRegion ( IClientConfig clientConfig, string serviceName, RegionEndpoint alternateEndpoint, IRequest request ) : string
clientConfig IClientConfig
serviceName string
alternateEndpoint RegionEndpoint
request IRequest
리턴 string

FormatDateTime() 공개 정적인 메소드

Formats the supplied date and time for use in AWS4 signing, where various formats are used.
public static FormatDateTime ( System.DateTime dt, string formatString ) : string
dt System.DateTime
formatString string The required format
리턴 string

GetParametersToCanonicalize() 보호된 정적인 메소드

Collects the subresource and query string parameters into one collection ready for canonicalization
protected static GetParametersToCanonicalize ( IRequest request ) : string>.IDictionary
request IRequest The in-flight request being signed
리턴 string>.IDictionary

InitializeHeaders() 공개 정적인 메소드

Sets the AWS4 mandated 'host' and 'x-amz-date' headers, returning the date/time that will be used throughout the signing process in various elements and formats.
public static InitializeHeaders ( string>.IDictionary headers, Uri requestEndpoint ) : System.DateTime
headers string>.IDictionary The current set of headers
requestEndpoint System.Uri
리턴 System.DateTime

InitializeHeaders() 공개 정적인 메소드

Sets the AWS4 mandated 'host' and 'x-amz-date' headers, accepting and returning the date/time that will be used throughout the signing process in various elements and formats.
public static InitializeHeaders ( string>.IDictionary headers, Uri requestEndpoint, System.DateTime requestDateTime ) : System.DateTime
headers string>.IDictionary The current set of headers
requestEndpoint System.Uri
requestDateTime System.DateTime
리턴 System.DateTime

SetRequestBodyHash() 공개 정적인 메소드

If the caller has already set the x-amz-content-sha256 header with a pre-computed content hash, or it is present as ContentStreamHash on the request instance, return the value to be used in request canonicalization. If not set as a header or in the request, attempt to compute a hash based on inspection of the style of the request content.
public static SetRequestBodyHash ( IRequest request ) : string
request IRequest
리턴 string

Sign() 공개 메소드

Calculates and signs the specified request using the AWS4 signing protocol by using the AWS account credentials given in the method parameters. The resulting signature is added to the request headers as 'Authorization'. Parameters supplied in the request, either in the resource path as a query string or in the Parameters collection must not have been uri encoded. If they have, use the SignRequest method to obtain a signature.
/// If any problems are encountered while signing the request. ///
public Sign ( IRequest request, IClientConfig clientConfig, RequestMetrics metrics, string awsAccessKeyId, string awsSecretAccessKey ) : void
request IRequest /// The request to compute the signature for. Additional headers mandated by the AWS4 protocol /// ('host' and 'x-amz-date') will be added to the request before signing. ///
clientConfig IClientConfig /// Client configuration data encompassing the service call (notably authentication /// region, endpoint and service name). ///
metrics Amazon.Runtime.Internal.Util.RequestMetrics /// Metrics for the request ///
awsAccessKeyId string /// The AWS public key for the account making the service call. ///
awsSecretAccessKey string /// The AWS secret key for the account making the call, in clear text. ///
리턴 void

SignBlob() 공개 정적인 메소드

Returns the HMAC256 for an arbitrary blob using the specified key
public static SignBlob ( byte key, byte data ) : byte[]
key byte
data byte
리턴 byte[]

SignBlob() 공개 정적인 메소드

Returns the HMAC256 for an arbitrary blob using the specified key
public static SignBlob ( byte key, string data ) : byte[]
key byte
data string
리턴 byte[]

SignRequest() 공개 메소드

Calculates and signs the specified request using the AWS4 signing protocol by using the AWS account credentials given in the method parameters.
Parameters passed as part of the resource path should be uri-encoded prior to entry to the signer. Parameters passed in the request.Parameters collection should be not be encoded; encoding will be done for these parameters as part of the construction of the canonical request.
/// If any problems are encountered while signing the request. ///
public SignRequest ( IRequest request, IClientConfig clientConfig, RequestMetrics metrics, string awsAccessKeyId, string awsSecretAccessKey ) : AWS4SigningResult
request IRequest /// The request to compute the signature for. Additional headers mandated by the AWS4 protocol /// ('host' and 'x-amz-date') will be added to the request before signing. ///
clientConfig IClientConfig /// Client configuration data encompassing the service call (notably authentication /// region, endpoint and service name). ///
metrics Amazon.Runtime.Internal.Util.RequestMetrics /// Metrics for the request. ///
awsAccessKeyId string /// The AWS public key for the account making the service call. ///
awsSecretAccessKey string /// The AWS secret key for the account making the call, in clear text. ///
리턴 AWS4SigningResult

SortAndPruneHeaders() 보호된 정적인 메소드

Reorders the headers for the request for canonicalization.
For AWS4 signing, all headers are considered viable for inclusion
protected static SortAndPruneHeaders ( string>.IEnumerable requestHeaders ) : string>.IDictionary
requestHeaders string>.IEnumerable The set of proposed headers for the request
리턴 string>.IDictionary

프로퍼티 상세

TerminatorBytes 공개적으로 정적으로 프로퍼티

public static byte[] TerminatorBytes
리턴 byte[]