The Protocol Engine's Contexts (Diffie-Hellman)

The protocol engine will create one or more contexts via a call to CryptAcquireContext with the dwProvType parameter set to PROV_DH_SCHANNEL. The dwFlags parameter will usually have the CRYPT_VERIFYCONTEXT flag set. These contexts are used to perform key exchange operations as well as bulk encryption.

The DH keys used by Schannel are always ephemeral. Because the key pairs are ephemeral, the CRYPT_VOLATILE flag is usually specified when CryptGenKey is called to create it. This flag requests that the key pair not be written to permanent storage.