How to use CAPI's CryptImportKey with PEM encode public key from OpenSSL?
问题 How do I get the Microsoft's CryptoAPI CryptImportKey function to import a PEM encoded key? It actually works but CryptDecrypt returns an error. // 1. Generate a Public/Private RSA key pair like so: openssl genrsa -out private.pem 2048 openssl rsa -in private.pem -out public.pem -outform PEM -pubout // 2. Create a digital signaure using OpenSSL // Load Private key // -----BEGIN RSA PRIVATE KEY----- // BLAHBLAHBLAH // -----END RSA PRIVATE KEY----- // Concat user details std::string sUser =