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

Microsoft.IdentityModel.Tokens.CryptoProviderFactory

public class CryptoProviderFactory
Creates cryptographic operators by specifying a SecurityKey's and algorithms.
public static CryptoProviderFactory Default { get; set; }

Returns the default CryptoProviderFactory instance.

public static bool DefaultCacheSignatureProviders { get; set; }

Gets or sets the default value for caching of SignatureProvider's.

public static int DefaultSignatureProviderObjectPoolCacheSize { get; set; }

Gets or sets the maximum size of the object pool used by the SignatureProvider that are used for crypto objects.

public bool CacheSignatureProviders { get; set; }

Gets or sets a bool controlling if SignatureProvider should be cached.

Gets the CryptoProviderCache.

Extensibility point for creating custom cryptographic operators.

public int SignatureProviderObjectPoolCacheSize { get; set; }

Gets or sets the maximum size of the object pool used by the SignatureProvider that are used for crypto objects.

Initializes a new instance of the CryptoProviderFactory class.

Initializes a new instance of the CryptoProviderFactory class.

Initializes a new instance of the CryptoProviderFactory class.

Creates an instance of AuthenticatedEncryptionProvider for a specific key and algorithm.

public virtual SignatureProvider CreateForSigning(SecurityKey key, string algorithm)

Creates a SignatureProvider for signing with the specified key and algorithm.

public virtual SignatureProvider CreateForSigning(SecurityKey key, string algorithm, bool cacheProvider)

Creates a SignatureProvider for signing with the specified key and algorithm.

public virtual SignatureProvider CreateForVerifying(SecurityKey key, string algorithm)

Creates a SignatureProvider for verifying signatures with the specified key and algorithm.

public virtual SignatureProvider CreateForVerifying(SecurityKey key, string algorithm, bool cacheProvider)

Creates a SignatureProvider for verifying signatures with the specified key and algorithm.

Creates a HashAlgorithm instance for a specific hash algorithm.

public virtual HashAlgorithm CreateHashAlgorithm(string algorithm)

Creates a HashAlgorithm instance for a specific hash algorithm.

public virtual KeyedHashAlgorithm CreateKeyedHashAlgorithm(byte[] keyBytes, string algorithm)

Creates a KeyedHashAlgorithm instance for a specific keyed hash algorithm.

public virtual KeyWrapProvider CreateKeyWrapProvider(SecurityKey key, string algorithm)

Creates an instance of KeyWrapProvider for a specific key and algorithm.

public virtual KeyWrapProvider CreateKeyWrapProviderForUnwrap(SecurityKey key, string algorithm)

Creates an instance of KeyWrapProvider for a specific key and algorithm.

public virtual bool IsSupportedAlgorithm(string algorithm)

Determines whether the specified hash algorithm is supported.

public virtual bool IsSupportedAlgorithm(string algorithm, SecurityKey key)

Checks if the specified algorithm and SecurityKey are supported.

public virtual void ReleaseHashAlgorithm(HashAlgorithm hashAlgorithm)

Releases resources associated with a HashAlgorithm instance. The default behavior is to call Dispose.

public virtual void ReleaseKeyWrapProvider(KeyWrapProvider provider)

Releases resources associated with a KeyWrapProvider instance.

public virtual void ReleaseRsaKeyWrapProvider(RsaKeyWrapProvider provider)

Releases resources associated with an RsaKeyWrapProvider instance.

public virtual void ReleaseSignatureProvider(SignatureProvider signatureProvider)

Releases resources associated with a SignatureProvider instance.