Skip to main content

Methods

Decode()

Decodes a signature, or answers null when it is missing or not in encoding.

Parameters

string
required

Returns

byte[]

Hmac()

Signs content with the UTF-8 bytes of secret.

Parameters

string
required
ReadOnlySpan<byte>
required

Returns

byte[]

IsFresh()

Checks that a signed timestamp lies within tolerance of now, either side.

Parameters

Instant
required
Instant
required
Duration
required

Returns

bool

Matches()

Compares two signatures in the same time however much of them matches.

Parameters

ReadOnlySpan<byte>
required
ReadOnlySpan<byte>
required

Returns

bool

VerifyEcdsa()

Checks an ECDSA signature of content against the vendor’s PEM publicKey.

Parameters

string
required
ReadOnlySpan<byte>
required
ReadOnlySpan<byte>
required
HashAlgorithmName
required
DSASignatureFormat

Returns

bool

VerifyHmac()

Checks that claimed is the HMAC of content under secret.

Parameters

string
required
ReadOnlySpan<byte>
required
string
required
The signature the request carries, trimmed of surrounding space.

Returns

bool true if it is; otherwise, false, as it is for an empty secret and a missing or undecodable claim. The comparison takes the same time however much matches (rule E6).

VerifyRsa()

Checks an RSA PKCS #1 v1.5 signature of content against the vendor’s PEM publicKey.

Parameters

string
required
ReadOnlySpan<byte>
required
ReadOnlySpan<byte>
required
HashAlgorithmName
required

Returns

bool