Hi,
I am developing digital signature tools with java to be executed in Windows OS, so "Windows-My" is the certificate container used to retrieve the user certificates. Smart cards and HSM are also involved as the private key containers so it is necesary to provide CSP/CNG propietary libraries. The issue is that while there are no problems using sunmscapi provider to attach CSPs (old MS CAPI) libraries, i can't make it work using CNG (Crypto API: Next Generation). It seems like sunmscapi.dll is not capable to use the new cryptographic interface of MS. Is this true? Searching for some code of sunmscapi.dll through Internet i found that to recover private key information, CryptAcquireCertificatePrivateKey function is invoked, so maybe if CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG is set at dwFlags argument there will be no problem attching CNG libraries.
Maybe i am wrong and sunmscapi provider already support CNG (Key Store Provider) to recover private key information. I have tested KSP-CNG libraries and work well with other software to generate digital signatures.
I really appreciate if someone can help me with this or give some information in order to consider the ways to make it work.
Thanks.