C++ CryptAcquireCertificatePrivateKey (WinCrypt) does not detect newest cards (CA6)

204 views
Skip to first unread message

SGE

unread,
Mar 8, 2023, 9:42:14 AM3/8/23
to eID Middleware Dev
Hi,

we have followin code detecting the private key on a card=

BOOL isCardInReader(PCCERT_CONTEXT certContext) {
DWORD flags = CRYPT_ACQUIRE_CACHE_FLAG |      CRYPT_ACQUIRE_COMPARE_KEY_FLAG | CRYPT_ACQUIRE_SILENT_FLAG;     
NCRYPT_KEY_HANDLE key = 0;
DWORD spec = 0;
BOOL ncrypt = FALSE;

CryptAcquireCertificatePrivateKey(certContext, flags, 0, &key, &spec, &ncrypt);
if (!key) {
return FALSE;
}

...

With 'older' eID cards (root CA4)  the Cert is detected but with the 'newest' eid cards (root CA5(?), CA6) not.

Anyone any idea what needs to be done to make this code function with tha 'newest' cards ?

Thx

Stefan





Pierre Van Humbeeck

unread,
Apr 5, 2023, 4:16:03 AM4/5/23
to eID Middleware Dev
Hi,

I see that we have similar issue but in different techonology.
I manage to fix my problem by updating the  Pkcs11 wrapper.

I hope it can help with your problem.


Best regards,
Reply all
Reply to author
Forward
0 new messages