CryptoSys PKI .NET Class Library

Cipher.KeyWrap Method 

Wraps (encrypts) key material with a key-encryption key

[Visual Basic]
Public Shared Function KeyWrap( _
   ByVal data As Byte(), _
   ByVal kek As Byte(), _
   ByVal cipherAlg As CipherAlgorithm _
) As Byte()
[C#]
public static byte[] KeyWrap(
   byte[] data,
   byte[] kek,
   CipherAlgorithm cipherAlg
);

Parameters

data
Key material to be wrapped
kek
Key encryption key
cipherAlg
Block cipher to use for wrapping

Return Value

Wrapped key (or empty array on error)

See Also

Cipher Class | CryptoSysPKI Namespace