Table of Contents

Class Aws4HmacAuthorizationHeaderBuilder

Namespace
Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4
Assembly
Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4.dll

Provides a way to fluently represent a HTTP AWS4-HMAC-SHA256 Authentication header.

public class Aws4HmacAuthorizationHeaderBuilder : HmacAuthorizationHeaderBuilder<Aws4HmacAuthorizationHeaderBuilder>
Inheritance
Object
Aws4HmacAuthorizationHeaderBuilder
Inherited Members

Remarks

Constructors

Aws4HmacAuthorizationHeaderBuilder()

Initializes a new instance of the Aws4HmacAuthorizationHeaderBuilder class.

public Aws4HmacAuthorizationHeaderBuilder()

Methods

AddCredentialScope(DateTime, String, String, String)

Adds the credential scope that defines the remote resource.

public Aws4HmacAuthorizationHeaderBuilder AddCredentialScope(DateTime timestamp, string region = "eu-west-1", string service = "s3", string termination = "aws4_request")

Parameters

timestamp DateTime

The System.DateTime value part of the credential scope.

region String

The AWS region part of the credential scope. Default is eu-west-1.

service String

The service name part of the credential scope. Default is s3 (Simple Storage Service).

termination String

The termination string part of the credential scope. Default is aws4_request.

Returns

Aws4HmacAuthorizationHeaderBuilder

A reference to this instance so that additional calls can be chained.

Remarks

The following string represents the scope part of the Credential parameter for a S3 request in the eu-west-1 Region: 20220710/eu-west-1/s3/aws4_request

AddFromRequest(HttpRequest)

Adds the necessary fields that is part of an HTTP request.

public override Aws4HmacAuthorizationHeaderBuilder AddFromRequest(HttpRequest request)

Parameters

request HttpRequest

An instance of the Microsoft.AspNetCore.Http.HttpRequest object.

Returns

Aws4HmacAuthorizationHeaderBuilder

A reference to this instance so that additional calls can be chained.

Build()

Builds an instance of HmacAuthorizationHeader that implements AuthorizationHeader.

public override HmacAuthorizationHeader Build()

Returns

HmacAuthorizationHeader

An instance of HmacAuthorizationHeader.

Remarks

ComputeCanonicalRequest()

Converts the request to a standardized (canonical) format and computes a message digest.

public override string ComputeCanonicalRequest()

Returns

String

A System.String representation, in hexadecimal, of the computed canonical request.

Remarks

ComputeSignature()

Computes the signature of this instance using a series of hash-based message authentication codes (HMACs).

public override string ComputeSignature()

Returns

String

A System.String representation, in hexadecimal, of the computed signature of this instance.

Remarks

See Also

HmacAuthorizationHeaderBuilder<TAuthorizationHeaderBuilder>