background preloader

CAPI Microsoft Windows

Facebook Twitter

The Smart Card Cryptographic Service Provider Cookbook. Anusha Nirmalananthan Microsoft Corporation October 2002 Applies to: Microsoft® Windows® Cryptographic Service Providers Smart cards Summary: This article provides background information for Cryptographic Service Provider (CSP) developers. It brings together information already available on MSDN about smart cards, cryptography, and CSPs, then goes on to detail the calls that are made to the CSPs in typical scenarios, important design considerations, and smart card-specific error codes. (24 printed pages) Contents Introduction to Smart Cards and CSPsWriting CSPsTesting CSPsSigning CSPsMore Information Introduction to Smart Cards and CSPs This section provides background information about smart cards, the smart card subsystem architecture and CSP types, and the differences between hardware and software CSPs.

Smart Card Basics Smart cards usually come in two forms. The PC/SC workgroup set a standard for integrating smart cards and smart card readers into the mainstream computing environment. CryptSetProvParam Function. Crypt32.dll Detail. CryptAcquireContext function. With the appropriate setting of dwFlags, this function can also create and destroy key containers and can provide access to a CSP with a temporary key container if access to a private key is not required. Syntax BOOL WINAPI CryptAcquireContext( _Out_ HCRYPTPROV *phProv, _In_ LPCTSTR pszContainer, _In_ LPCTSTR pszProvider, _In_ DWORD dwProvType, _In_ DWORD dwFlags ); Parameters phProv [out] pszContainer [in] The key container name.

This is a null-terminated string that identifies the key container to the CSP. For more information about the usage of the pszContainer parameter, see Remarks. pszProvider [in] A null-terminated string that contains the name of the CSP to be used. The default CSP can change between operating system releases. DwProvType [in] dwFlags [in] Flag values. Return value If the function succeeds, the function returns nonzero (TRUE). The error codes prefaced by NTE are generated by the particular CSP being used. Remarks Examples Requirements See also. NTE error codes.