2

I need to extract an RSA private key from a .p15 keyset that was created/maintained by CRYPTLIB. I am able to open the keyset (CryptOpenKeyset), and load it into a CRYPT_CONTEXT (cryptGetPrivateKey), but now what? Ideally I need it in PEM format for use by OPENSSL. How can this be done?

1 Answers1

0

I don't think this is possible. As of my knowledge cryptlib has no API to export private keys. I guess this is simply for security reasons. The only way I can think of is to write an ASN1 parser and extract and decrypt the private key from the pkcs15 structure.

David J
  • 1,554
  • 9
  • 15