How to import private key in PEM format using WinCrypt and C++?
I'm trying to use the WinCrypt API in C++. My application need to cipher, decipher, sign and verify files, and I know how to do that once I have the correct keys. But my problem is actually that that is NOT the same application which generates those keys. What I have is public and private keys in files in PEM format : -----BEGIN RSA PRIVATE KEY----- [Base64 encoded] -----END RSA PRIVATE KEY----- And : -----BEGIN RSA PUBLIC KEY----- [Base64 encoded] -----END RSA PUBLIC KEY----- After some research, I have found how to import the public key : here and here , using the following methods :