3

I need to set Private Key Pin without CSP window.

I've got an CERT_CONTEXT structure and i call CryptAcquireCertificatePrivateKey with silent flag. Function fails with NTE_SILENT_CONTEXT error message. It means that pin was not specified or incorrect and the CSP window was blocked. I need to get private key provider to set pin via CryptSetProvParam function. How can I get provider only by CERT_CONTEXT structure?

Treno1
  • 139
  • 1
  • 2
  • 9

1 Answers1

0

You want to use CryptSetProvParam with PP_KEYEXCHANGE_PIN (or PP_SIGNATURE_PIN). This flag is not supported by the default Microsoft crypto-service-provider (it is intended for use with smartcard-based CSPs).

rmhrisk
  • 1,814
  • 10
  • 16