Group: Cryptography Reference - Library: advapi32
The CryptAcquireContext function is used to acquire a handle to a particular key container within a particular cryptographic service provider (CSP). This returned handle is used in calls to CryptoAPI functions that use the selected CSP.
How to fill a buffer with random bytes using Cryptography API Functions
CryptoAPI: Collection of Providers class
How to create MD-5 and SHA-1 hash values from a string
A class that encrypts and decrypts files using Cryptography API Functions
Generating random cryptographic keys
BOOL WINAPI CryptAcquireContext(
HCRYPTPROV* phProv,
LPCTSTR pszContainer,
LPCTSTR pszProvider,
DWORD dwProvType,
DWORD dwFlags
);
DECLARE INTEGER CryptAcquireContext IN advapi32;
INTEGER @ hProvHandle,;
STRING cContainer, ;
STRING cProvider,;
INTEGER nProvType,;
INTEGER nFlags
phProv [out] Pointer to a handle of a CSP.
pszContainer [in] Key container name.
pszProvider [in] A null-terminated string that specifies the name of the CSP to be used.
dwProvType [in] Specifies the type of provider to acquire.
dwFlags [in] Flag values.
If the function succeeds, the function returns nonzero (TRUE).
When you have finished using the CSP, release the handle by calling the CryptReleaseContext function.