Table of Contents

Class HmacAuthorizationHeaderBuilder<TAuthorizationHeaderBuilder>

Namespace
Cuemon.AspNetCore.Authentication.Hmac
Assembly
Cuemon.AspNetCore.Authentication.dll

Represents the base class from which all builder implementations that represent a HTTP HMAC Authentication header should derive.

public abstract class HmacAuthorizationHeaderBuilder<TAuthorizationHeaderBuilder> : AuthorizationHeaderBuilder<HmacAuthorizationHeader, TAuthorizationHeaderBuilder> where TAuthorizationHeaderBuilder : HmacAuthorizationHeaderBuilder<TAuthorizationHeaderBuilder>

Type Parameters

TAuthorizationHeaderBuilder
Inheritance
HmacAuthorizationHeaderBuilder<TAuthorizationHeaderBuilder>
Derived
Inherited Members

Constructors

HmacAuthorizationHeaderBuilder(String)

Initializes a new instance of the HmacAuthorizationHeaderBuilder<TAuthorizationHeaderBuilder> class.

protected HmacAuthorizationHeaderBuilder(string authenticationScheme)

Parameters

authenticationScheme String

The name of the authentication scheme.

Methods

AddClientId(String)

Adds the client identifier that is the public key of the signing process.

public TAuthorizationHeaderBuilder AddClientId(string clientId)

Parameters

clientId String

The client identifier that is the public key of the signing process.

Returns

TAuthorizationHeaderBuilder

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

AddClientSecret(String)

Adds the client secret that is the private key of the signing process.

public TAuthorizationHeaderBuilder AddClientSecret(string clientSecret)

Parameters

clientSecret String

The client secret that is the private key of the signing process.

Returns

TAuthorizationHeaderBuilder

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

AddFromRequest(HttpRequest)

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

public abstract TAuthorizationHeaderBuilder AddFromRequest(HttpRequest request)

Parameters

request HttpRequest

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

Returns

TAuthorizationHeaderBuilder

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

AddSignedHeaders(String[])

Adds the headers that will be part of the signing process.

public virtual TAuthorizationHeaderBuilder AddSignedHeaders(params string[] signedHeaders)

Parameters

signedHeaders String[]

The headers that will be part of the signing process.

Returns

TAuthorizationHeaderBuilder

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

ComputeCanonicalRequest()

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

public abstract string ComputeCanonicalRequest()

Returns

String

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

ComputeSignature()

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

public abstract string ComputeSignature()

Returns

String

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