InMemorySymmetricSecurityKey.EncryptKey Method (String, Byte[])

 

Encrypts the specified key.

Namespace:   System.IdentityModel.Tokens
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

public override byte[] EncryptKey(
	string algorithm,
	byte[] keyData
)

Parameters

algorithm
Type: System.String

The cryptographic algorithm to encrypt the key with.

keyData
Type: System.Byte[]

An array of Byte that contains the key.

Return Value

Type: System.Byte[]

An array of Byte that contains the encrypted key.

Exception Condition
InvalidOperationException

algorithm is not supported. The supported algorithms are TripleDesKeyWrap, Aes128KeyWrap, Aes192KeyWrap, or Aes256KeyWrap.

Use the static fields of the SecurityAlgorithms class to specify the algorithm.

.NET Framework
Available since 3.0
Return to top
Show: