CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID
From: sunit (sunit_at_newsgroup.nospam)
Date: 10/27/05
- Next message: sunit: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Previous message: joy: "winlogon not loading 32 bit xxgina.dll in xp 64 bit"
- Next in thread: sunit: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Reply: sunit: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Reply: Alun Jones: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 27 Oct 2005 05:46:19 +0530
I used CertSetContextProperty with CERT_KEY_PROV_INFO_PROP_ID to add my Private key Blob(stored in a key container) in the Certificate Context. .
But the program 's execution is halted at CertSetContextProperty and a dialog Box appears(OK and CANCEL).Even the Process is not terminated .To terminate the process I have to use Task Manager
/*here is the code*/
// Declare and initialize variables.for CRYPT_KEY_PROV_INFO
CRYPT_KEY_PROV_INFO cryptprivkeyinfo;
//store the name of the container
cryptprivkeyinfo.pwszContainerName=L"saysnetsoft"; // name of the container
//store the name of the CSP name ie MS_DEF_PROV_W
cryptprivkeyinfo.pwszProvName= MS_DEF_PROV_W
//provider type
cryptprivkeyinfo.dwProvType =PROV_RSA_FULL;
cryptprivkeyinfo.dwFlags = CERT_SET_KEY_CONTEXT_PROP_ID;
cryptprivkeyinfo .rgProvParam=NULL;
cryptprivkeyinfo.dwKeySpec=AT_SIGNATURE;
const void *pvData=(LPVOID)&cryptprivkeyinfo;
if(!(CertSetCertificateContextProperty(m_pCertContext,//pointer to the certificate context
CERT_KEY_PROV_INFO_PROP_ID,//get the private key from file
NULL,
pvData)))
{
::OutputDebugString(TEXT("error:CertSetCertificateContextProperty.\n"));
}
- Next message: sunit: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Previous message: joy: "winlogon not loading 32 bit xxgina.dll in xp 64 bit"
- Next in thread: sunit: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Reply: sunit: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Reply: Alun Jones: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]