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
signingKeyAsymmetricAlgorithmThe private half of the client's key pair, whose kind decides the signature algorithm.
audiencestringThe surface the assertion is presented to, which is one of the audiences ClientAssertion names.
mintedAtDateTimeOffsetThe 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
signingKeyoraudienceis null.- NotSupportedException
Thrown when the key is of a kind no permitted signature algorithm covers.