Partilhar via


CryptoProviderFactory.CreateKeyWrapProviderForUnwrap Method

Definition

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

public virtual Microsoft.IdentityModel.Tokens.KeyWrapProvider CreateKeyWrapProviderForUnwrap (Microsoft.IdentityModel.Tokens.SecurityKey key, string algorithm);
abstract member CreateKeyWrapProviderForUnwrap : Microsoft.IdentityModel.Tokens.SecurityKey * string -> Microsoft.IdentityModel.Tokens.KeyWrapProvider
override this.CreateKeyWrapProviderForUnwrap : Microsoft.IdentityModel.Tokens.SecurityKey * string -> Microsoft.IdentityModel.Tokens.KeyWrapProvider
Public Overridable Function CreateKeyWrapProviderForUnwrap (key As SecurityKey, algorithm As String) As KeyWrapProvider

Parameters

key
SecurityKey

The SecurityKey to use.

algorithm
String

The algorithm to use.

Returns

An instance of KeyWrapProvider.

Exceptions

Thrown if algorithm is null or empty.

Thrown if the combination of key and algorithm is not supported.

Thrown if the type returned by Create(String, Object[]) is not assignable to KeyWrapProvider.

Remarks

If CustomCryptoProvider is set and IsSupportedAlgorithm(String, Object[]) returns true, Create(String, Object[]) is called to obtain the KeyWrapProvider.

Once done with the KeyWrapProvider, call ReleaseKeyWrapProvider(KeyWrapProvider).

Applies to