Table of Contents

Class AWS4PreSignedUrlSigner

Namespace
Amazon.Runtime.Internal.Auth
Assembly
AWSSDK.Core.dll

AWS4 protocol signer for Amazon S3 presigned urls.

public class AWS4PreSignedUrlSigner : AWS4Signer
Inheritance
AWS4PreSignedUrlSigner
Inherited Members

Constructors

AWS4PreSignedUrlSigner()

public AWS4PreSignedUrlSigner()

Fields

MaxAWS4PreSignedUrlExpiry

public const long MaxAWS4PreSignedUrlExpiry = 604800

Field Value

long

ServicesUsingUnsignedPayload

public static readonly IEnumerable<string> ServicesUsingUnsignedPayload

Field Value

IEnumerable<string>

Methods

Sign(IRequest, IClientConfig, RequestMetrics, ImmutableCredentials)

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'.

public override void Sign(IRequest request, IClientConfig clientConfig, RequestMetrics metrics, ImmutableCredentials credentials)

Parameters

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

Adding supporting data for the service call required by the signer (notably authentication region, endpoint and service name).

metrics RequestMetrics

Metrics for the request

credentials ImmutableCredentials

The AWS credentials for the account making the service call.

Exceptions

SignatureException

If any problems are encountered while signing the request.

Sign(IRequest, IClientConfig, RequestMetrics, string, string)

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'.

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

Parameters

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

Adding supporting data for the service call required by the signer (notably authentication region, endpoint and service name).

metrics 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

Exceptions

SignatureException

If any problems are encountered while signing the request.

SignRequest(IRequest, IClientConfig, RequestMetrics, string, string)

Calculates the AWS4 signature for a presigned url.

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

Parameters

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. If the Expires parameter is present, it is renamed to 'X-Amz-Expires' before signing.

clientConfig IClientConfig

Adding supporting data for the service call required by the signer (notably authentication region, endpoint and service name).

metrics 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

Returns

AWS4SigningResult

Remarks

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.

Exceptions

SignatureException

If any problems are encountered while signing the request.

SignRequest(IRequest, IClientConfig, RequestMetrics, string, string, string, string)

Calculates the AWS4 signature for a presigned url.

public static AWS4SigningResult SignRequest(IRequest request, IClientConfig clientConfig, RequestMetrics metrics, string awsAccessKeyId, string awsSecretAccessKey, string service, string overrideSigningRegion)

Parameters

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. If the Expires parameter is present, it is renamed to 'X-Amz-Expires' before signing.

clientConfig IClientConfig

Adding supporting data for the service call required by the signer (notably authentication region, endpoint and service name).

metrics 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

service string

The service to sign for

overrideSigningRegion string

The region to sign to, if null then the region the client is configured for will be used.

Returns

AWS4SigningResult

Remarks

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.

The X-Amz-Content-SHA256 is cleared out of the request. If the request is for S3 then the UNSIGNED_PAYLOAD value is used to generate the canonical request. If the request isn't for S3 then the empty body SHA is used to generate the canonical request.

Exceptions

SignatureException

If any problems are encountered while signing the request.