Phase 1

In Phase 1, the sender creates a random session key, to be known as "session key A," by using the CryptGenKey function. The sender then uses CryptExportKey to export this key into a simple key blob, specifying that the receiver's key exchange public key be used to encrypt the key blob. This key blob is then sent to the receiver.

The receiver accepts the key blob from the sender and imports it into its CSP by using the CryptImportKey function. This function returns a handle to session key A to the receiver.