SymmetricKeyWrapProvider(SecurityKey, String) Constructor

Definition

Initializes a new instance of the KeyWrapProvider class used for wrapping and unwrapping keys.

public SymmetricKeyWrapProvider (Microsoft.IdentityModel.Tokens.SecurityKey key, string algorithm);
new Microsoft.IdentityModel.Tokens.SymmetricKeyWrapProvider : Microsoft.IdentityModel.Tokens.SecurityKey * string -> Microsoft.IdentityModel.Tokens.SymmetricKeyWrapProvider
Public Sub New (key As SecurityKey, algorithm As String)

Parameters

key
SecurityKey

The SecurityKey that will be used for cryptographic operations.

algorithm
String

The KeyWrap algorithm to be used.

Exceptions

Thrown if algorithm is null.

Thrown if the SecurityKey cannot be converted to a byte array.

Thrown if the key size doesn't match the algorithm.

Thrown if failed to create a symmetric algorithm with the provided key and algorithm.

Applies to