if(CryptAcquireContext(
&hProv,
Container_NAME,
CSP_NAME,
PROV_RSA_FULL,
0
)) // Flag values
{
printf("A crypto context with the %s key container \n", UserName);
printf("has been acquired.\n\n");
}
else
{
//--------------------------------------------------------------------
// Some sort of error occurred in acquiring the context.
// Create a new default key container.
if(CryptAcquireContext(
&hProv,
Container_NAME,
CSP_NAME,
PROV_RSA_FULL,
CRYPT_NEWKEYSET))
{
printf("A new key container has been created.\n");
}
else
{
HandleError("Could not create a new key container.\n");
}
} // End of else