Setting the User Default CSP

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

One user default cryptographic service provider (CSP) can be specified for each CSP type. This entry is used when an application calls the CryptAcquireContext function with only a CSP type specified.

The user defaults are stored in the registry key HKEY_CURRENT_USER.

The user default CSP is set by the CryptSetProvider function, which internally sets the following registry entry.

[HKEY_CURRENT_USER\Comm\Security\Crypto\Defaults\Providers\Type CSP type]
    Name = REG_SZ:CSP name

The CSP type portion of the key name must be in decimal format and exactly three digits in length. For example, if the CSP were of type 25, the key name would be 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.

The following example shows how to set the CSP name.

[HKEY_CURRENT_USER\Comm\Security\Crypto\Defaults\Provider Types\Type 042]
    Name = REG_SZ:XYZ Provider

See Also

Concepts

Cryptography Registry Settings
About Cryptographic Service Provider
Microsoft Cryptographic System

Other Resources

Cryptography
Certificates