Class AWS4aSignerCRTWrapper
Asymmetric SigV4 signer using a the AWS Common Runtime implementation of SigV4a via AWSSDK.Extensions.CrtIntegration
public class AWS4aSignerCRTWrapper : AbstractAWSSigner
- Inheritance
-
AWS4aSignerCRTWrapper
- Inherited Members
Constructors
AWS4aSignerCRTWrapper()
Instantiates an SigV4a signer using CRT's SigV4a implementation
public AWS4aSignerCRTWrapper()
AWS4aSignerCRTWrapper(bool)
Instantiates an SigV4a signer using CRT's SigV4a implementation
public AWS4aSignerCRTWrapper(bool signPayload)
Parameters
signPayload
boolWhether to sign the request's payload
Properties
Protocol
Protocol for the requests being signed
public override ClientProtocol Protocol { get; }
Property Value
Methods
Presign4a(IRequest, IClientConfig, RequestMetrics, ImmutableCredentials, string, string)
Calculates the asymmetric Sigv4 (Sigv4a) signature for a presigned url.
public AWS4aSigningResult Presign4a(IRequest request, IClientConfig clientConfig, RequestMetrics metrics, ImmutableCredentials credentials, string service, string overrideSigningRegion)
Parameters
request
IRequestThe request to compute the signature for.
clientConfig
IClientConfigAdding supporting data for the service call required by the signer (notably authentication region, endpoint and service name).
metrics
RequestMetricsMetrics for the request
credentials
ImmutableCredentialsThe AWS credentials for the account making the service call.
service
stringThe service to sign for
overrideSigningRegion
stringThe region to sign to, if null then the region the client is configured for will be used.
Returns
- AWS4aSigningResult
AWS4a Signing Result
Sign(IRequest, IClientConfig, RequestMetrics, ImmutableCredentials)
Calculates and signs the specified request using the asymmetric Sigv4 (Sigv4a) signing protocol. 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.
public override void Sign(IRequest request, IClientConfig clientConfig, RequestMetrics metrics, ImmutableCredentials credentials)
Parameters
request
IRequestThe request to compute the signature for. Additional headers mandated by the AWS4a protocol ('host' and 'x-amz-date') will be added to the request before signing.
clientConfig
IClientConfigClient configuration data encompassing the service call (notably authentication region, endpoint and service name).
metrics
RequestMetricsMetrics for the request
credentials
ImmutableCredentialsThe AWS credentials for the account making the service call.
Sign(IRequest, IClientConfig, RequestMetrics, string, string)
public override void Sign(IRequest request, IClientConfig clientConfig, RequestMetrics metrics, string awsAccessKeyId, string awsSecretAccessKey)
Parameters
request
IRequestclientConfig
IClientConfigmetrics
RequestMetricsawsAccessKeyId
stringawsSecretAccessKey
string
SignChunk(Stream, string, AWS4aSigningResult)
Calculates the signature for a single chunk of a chunked SigV4a request
public string SignChunk(Stream chunkBody, string previousSignature, AWS4aSigningResult headerSigningResult)
Parameters
chunkBody
StreamContent of the current chunk
previousSignature
stringSignature of the previous chunk
headerSigningResult
AWS4aSigningResultSigning result of the request's header
Returns
- string
Unpadded SigV4a signature of the given chunk
SignRequest(IRequest, IClientConfig, RequestMetrics, ImmutableCredentials)
Calculates and signs the specified request using the asymmetric Sigv4 (Sigv4a) signing protocol. 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.
public AWS4aSigningResult SignRequest(IRequest request, IClientConfig clientConfig, RequestMetrics metrics, ImmutableCredentials credentials)
Parameters
request
IRequestThe request to compute the signature for. Additional headers mandated by the AWS4a protocol ('host' and 'x-amz-date') will be added to the request before signing.
clientConfig
IClientConfigClient configuration data encompassing the service call (notably authentication region, endpoint and service name).
metrics
RequestMetricsMetrics for the request
credentials
ImmutableCredentialsThe AWS credentials for the account making the service call.
Returns
- AWS4aSigningResult
AWS4a Signing Result
SignTrailingHeaderChunk(IDictionary<string, string>, string, AWS4aSigningResult)
Signs the final chunk containing trailing headers
public string SignTrailingHeaderChunk(IDictionary<string, string> trailingHeaders, string previousSignature, AWS4aSigningResult headerSigningResult)
Parameters
trailingHeaders
IDictionary<string, string>Trailing header keys and values
previousSignature
stringSignature of the previously signed chunk
headerSigningResult
AWS4aSigningResultSigning result for the "seed" signature consisting of headers
Returns
- string
Signature of the trailing header chunk