Exporting Cryptographic Keys (Windows CE 5.0)

Send Feedback

There are two occasions when it is necessary to export keys from the more secure cryptographic service provider (CSP) environment into a key BLOB:

  • To save a session key for use by an application

    For example, if your application encodes a database file and you want your application to decode this file later, then the application must store the session key. This is necessary because CSPs do not preserve symmetric keys between sessions.

  • To send a key to someone else

    This would be much easier for your application if the respective CSPs could communicate directly, but they cannot. This means that the key must be exported from your CSP, transmitted by your application to the destination application, and then imported to the destination CSP.

The following table shows functions you can use to create, configure, and destroy cryptographic keys, and to exchange them with other users.

Function Description
CryptDestroyKey Destroys a key.
CryptExportKey Exports a key from a CSP into a key BLOB in the application memory space.
CryptGenRandom Generates random data, usually for salt values.
CryptGetKeyParam Retrieves key parameters.
CryptGetUserKey Gets a handle to the key exchange or signature key.
CryptImportKey Imports a key from a key BLOB into a CSP.
CryptSetKeyParam Specifies key parameters.

See Also

Cryptography | Microsoft Cryptographic System | Certificates

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.