Re: CryptImportPublicKeyInfo....No key handle

anonymous_at_discussions.microsoft.com
Date: 04/10/04


Date: Sat, 10 Apr 2004 00:16:57 -0700

Hi all

Thankyou Ryan

Yes I tried CryptImportPublicKeyInfo(). But I am not
getting the key handle. What I did was.

CryptAcquireContext(&hCryptProv,NULL,NULL
        ,0,CRYPT_VERIFYCONTEXT);

CertOpenStor(CERT_STORE_PROV_SYSTEM,ENCODE_TYPE,
hCryptProv,CERT_SYSTEM_STORE_CURRENT_USER,L"My")

CertFindCertificateInStore
(hCertStore,ENCODE_TYPE,0,0,NULL,NULL)

PCERT_PUBLIC_KEY_INFO PublicKeyInfo;
PublicKeyInfo=&(pSignerCert->
pCertInfo->SubjectPublicKeyInfo);

CryptImportPublicKeyInfo(hCryptProv,ENCODE_TYPE
        ,PublicKeyInfo,&pPublicKey);

//here when i check the pPulbicKey its null.
//Am getting all other handles as required.
//I feel theres a error in some of the settings.
Regards
Shiraz
mshiraz@cordiant.net