ideawu / Objective-C-RSA

Doing RSA encryption and decryption with Objective-C on iOS
http://www.ideawu.com/blog/post/132.html
Other
1.15k stars 280 forks source link

我用命令行生成的公钥和私钥为什么不能用 #21

Open imokoi opened 8 years ago

imokoi commented 8 years ago

公钥和私钥和你的格式一样,但是为什么可以加密 但解密出来的就是nil 啊 ?急问

imokoi commented 8 years ago

也就是把你这个程序中上面的那两个privatekey和publickey换为自己生成的就解密不出来了 ,是不是我生成的密钥有问题啊

hulefei commented 8 years ago

同问

liujinlongxa commented 7 years ago

同问

ideawu commented 7 years ago

请确保生成的证书格式和例子中完全一致!

bang590 commented 6 years ago

需要把私钥转换为PKCS8格式: openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform pem -nocrypt -out pkcs8.pem