AcquireCredentialsHandle returns SEC_E_UNKNOWN_CREDENTIALS
From: sunit (sunit_at_newsgroup.nospam)
Date: 10/28/05
- Next message: Michel Gallant: "Re: Encryption always returning a different value with same key?"
- Previous message: sunit: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Next in thread: sunit: "Re: AcquireCredentialsHandle returns SEC_E_UNKNOWN_CREDENTIALS"
- Reply: sunit: "Re: AcquireCredentialsHandle returns SEC_E_UNKNOWN_CREDENTIALS"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 28 Oct 2005 14:44:41 +0530
I used AcquireCredentailsHandle to get the credentials of my SSL Socket for Server but it returns an error SEC_E_UNKNOWN_CREDENTIALS. When I checked in the Event Viewer, it displayed
A fatal occurred when attempting to access the SSL Server credentials private keys.The error code returned by the Crytographic module is 0x80090009
I have obtained my private keys using openssl. Then converted into the format needed by CrytoAPI(little
endian order) . I have created my key container as Machine Key Container (CRYPT_MACHINE_KEYSET) .I have used
Provider Type: PROV_RSA_FULL
Provider Name: MS_DEF_PROV
my certicate is in MY (system Store)
/*code for AcquireCredentialsHandle*/
ZeroMemory(&m_SchannelCred, sizeof(m_SchannelCred));
//Credentials are required by the Schannel authentication
m_SchannelCred.dwVersion = SCHANNEL_CRED_VERSION;
m_SchannelCred.cCreds = 1; //only one certificate store
m_SchannelCred.paCred = &m_pCertContext; //pointer to the pointer of CERT_CONTEXT structure this how the certificate enters the credential which is used for security context in schannel authentication
m_SchannelCred.hRootStore = m_hMyCertStore;//handle to certificate store
m_SchannelCred.dwMinimumCipherStrength = 80;//strength of cipher
m_SchannelCred.grbitEnabledProtocols =m_dwProtocol; //use any protocol
m_SchannelCred.dwFlags |= SCH_CRED_NO_SYSTEM_MAPPER ;
//using the Schannel SSP
//function, which returns a handle to the requested credentials
Status = m_SecurityFunc.AcquireCredentialsHandle( NULL, // Name of principal
UNISP_NAME,//schannel package requested
SECPKG_CRED_INBOUND,
NULL,
&m_SchannelCred,//structure contains the data required for SChannel
NULL,
NULL,
phCreds,//pointer to CreHandle which receives the handle to credentials
&tsExpiry);
if(Status != SEC_E_OK && Status==SEC_E_UNKNOWN_CREDENTIALS)
{
::OutputDebugString(_T("error:the handle to channel credential not available"));
}
I am not understanding where is the problem.Pls Help me.
Thanx for any advice
- Next message: Michel Gallant: "Re: Encryption always returning a different value with same key?"
- Previous message: sunit: "Re: CertSetContextProperty/CERT_KEY_PROV_INFO_PROP_ID"
- Next in thread: sunit: "Re: AcquireCredentialsHandle returns SEC_E_UNKNOWN_CREDENTIALS"
- Reply: sunit: "Re: AcquireCredentialsHandle returns SEC_E_UNKNOWN_CREDENTIALS"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|