Table of Contents

Method Mint

Namespace
MailFathom.Common.ClientAssertions
Assembly
MailFathom.Common.dll

Mint(AsymmetricAlgorithm, string, DateTimeOffset)

Mints one assertion for one surface.

public static string Mint(AsymmetricAlgorithm signingKey, string audience, DateTimeOffset mintedAt)

Parameters

signingKey AsymmetricAlgorithm

The private half of the client's key pair, whose kind decides the signature algorithm.

audience string

The surface the assertion is presented to, which is one of the audiences ClientAssertion names.

mintedAt DateTimeOffset

The moment the assertion is minted, from which its expiry is measured.

Returns

string

The compact serialization, ready to present as a bearer credential.

Remarks

The replay identifier is 128 bits from the cryptographic generator, so two assertions never collide by accident and no client can be made to mint one an endpoint has already seen.

Exceptions

ArgumentNullException

Thrown when signingKey or audience is null.

NotSupportedException

Thrown when the key is of a kind no permitted signature algorithm covers.