Platform SDK: Cryptography

Setting the Machine Default CSP

One machine default CSP can be specified for each CSP type. The machine default CSP is used if an application calls CryptAcquireContext with only a CSP type specified and no user default CSP registry entry exists.

Unless there are important reasons for setting up a custom CSP as the machine default CSP, the normal default CSP should not be changed. If a custom CSP must be used, the setup program can install its CSP as the machine default. If the normal default is to be changed, the following registry entry sets the machine default CSP:

HKEY_LOCAL_MACHINE
SOFTWARE
Microsoft
Cryptography
Defaults
Provider Type
Type
<CSP type>
>Name:REG_SZ:<CSP name>

The <CSP type> entry is in decimal format and exactly 3 digits in length. For example, if the CSP is of type 25, the key name is Type 025.

The <CSP Name> entry must be set to the textual name of the CSP. This must exactly match the <CSP Name> registry key discussed in Registering the CSP.