How to import private key in PEM format using WinCrypt and C++?

后端 未结 2 1057
你的背包
你的背包 2020-12-18 09:14

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. B

2条回答
  •  有刺的猬
    2020-12-18 09:39

    A PEM private key can be imported into CAPI by using CryptDecodeObjectEx with PKCS_RSA_PRIVATE_KEY and then calling CryptImportKey.

    I have written a sample that shows how to use a PEM encoded RSA private key for signing data using CAPI. Here is a link to it : http://www.idrix.fr/Root/Samples/capi_pem.cpp

    I hope this will help.

提交回复
热议问题