RSA_KemUnwrap Unwraps (decrypts) secret key material using RSA-KEM ("Simple RSA")
with the recipient's RSA private key.
Public Declare Function RSA_KemUnwrap Lib "diCrPKI.dll" (ByRef abOutput As Byte, ByVal nOutBytes As Long, ByRef abData As Byte, ByVal nDataLen As Long, ByVal strPrivateKey As String, ByVal nOptions As Long) As Long
nRet = RSA_KemUnwrap(abOutput(0), nOutBytes, abData(0), nDataLen, strPrivateKey, nOptions)
Byte array to receive the encrypted output.Long specifying the maximum length of the output array in bytes.Byte array containing the key material data to be wrapped.Long specifying the number of bytes in the data.String containing the recipient's private key in "internal" format.Long option flags.
Select one block cipher algorithm for the data encapsulation mechanism fromaes128-Wrap (default)aes192-Wrapaes256-Wrapcms3DESWrapsha1 (default)sha224sha256sha384sha512
long _stdcall RSA_KemUnwrap(unsigned char *lpOutput, long nOutBytes, const unsigned char *lpData, long nDataLen, const char *szPrivateKey, long nOptions);
Long:
If successful, the return value is the number of bytes in the output array;
otherwise it returns a negative error code.
public static byte[] KemUnwrap(
byte[] data,
string privateKey,
WrapAlgorithm wrap,
KdfFunc kdf,
HashAlgorithm kdfHashFunc
);
Public Shared Function KemUnwrap(
ByVal message As Byte(),
ByVal privateKey As String,
ByVal wrap As WrapAlgorithm,
ByVal kdf As KdfFunc,
ByVal kdfHashFunc As HashAlgorithm
) As Byte()
Refer to the .NET Help File for more details of the .NET equivalent methods.
This function unwraps, i.e. decrypts, key material wrapped by the RSA_KemWrap function.
The user must specify the same parameters used to wrap the key material.
No parity bit checks or changes are made for a Triple-DES key.
See RSA_KemWrap.
RSA_KemWrap CIPHER_KeyWrap CIPHER_KeyUnwrap