tags:

views:

240

answers:

1

If I have a key created from a unmanaged app and If I want to import this key in a managed app and generate another key or encrypt it. Basically the same key will be imported/exported back and forth from managed and unmanaged code.

Therefore what is the equivalent to

CryptExportKey(hKey, hPublicKey, SIMPLEBLOB, 0, lpData, &nSize);

and

CryptImportKey(hProv, lpData, nSize, NULL, 0, &hPublicKey);

in the managed world using RSACryptoServiceProvider?

What set of methods in the RSACryptoServiceProvider class are equivalent to the above Crypto APIs