|
Hi,
What happens is that the JCAPI DLL is calling the MS CAPI function CertGetCertificateContextProperty() with dwPropId set to CERT_KEY_PROV_INFO_PROP_ID
in order to get the name of the CSP from the returned CRYPT_KEY_PROV_INFO struct. Your error code indicates CRYPT_E_NOT_FOUND, which means The certificate does not have the specified property.
At a first glance, it doesn't seem that good for JCAPI to ask for the CRYPT_KEY_PROV_INFO struct since it holds the information about the private key associated with the certificate in question. That struct can not be returned for a certificate entry since it doesn't have a private key (only key entries have private keys and can thus return such a struct).
From your program's output, I assume that the alias My|8dsVZRHLJApzdktl+AJnmcBeIkE= trigger this problem. This certificate is stored in the MY system store which indicates that it should be a key entry, but it doesn't have to be since certificates without a private key can be stored there as well.
Is it possible for you to find out if the certificate with alias My|8dsVZRHLJApzdktl+AJnmcBeIkE= has a private key or not?
Meanwhile, I will setup a test case here to reproduce your problem.
Regards,
Tommy
|