<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.21.0" />

Microsoft.IdentityModel.Tokens.SignatureProvider

public abstract class SignatureProvider : IDisposable
Provides signature services, signing and verifying.
public string Algorithm { get; }

Gets the signature algorithm.

public string Context { get; set; }

Gets or sets a user context for a SignatureProvider.

Gets or sets the CryptoProviderCache that is associated with this SignatureProvider

public SecurityKey Key { get; }

Gets the SecurityKey.

public bool WillCreateSignatures { get; protected set; }

Gets or sets a bool indicating if this SignatureProvider is expected to create signatures.

protected SignatureProvider(SecurityKey key, string algorithm)

Initializes a new instance of the SignatureProvider class used to create and verify signatures.

public void Dispose()

Calls Dispose and SuppressFinalize

protected abstract void Dispose(bool disposing)

Can be over written in descendants to dispose of internal components.

public abstract byte[] Sign(byte[] input)

This must be overridden to produce a signature over the 'input'.

public virtual byte[] Sign(byte[] input, int offset, int count)

Produces a signature over the specified region of the input.

public abstract bool Verify(byte[] input, byte[] signature)

Verifies that the signature over input using the SecurityKey and Algorithm specified by this SignatureProvider are consistent.

public virtual bool Verify(byte[] input, int inputOffset, int inputLength, byte[] signature, int signatureOffset, int signatureLength)

Verifies that a signature created over the 'input' matches the signature. Using SecurityKey and 'algorithm' passed to #ctor.