Reading RSA Private Key in PEM format And Reading public Key from certificate

爱⌒轻易说出口 提交于 2019-12-11 23:17:23

问题


I'm trying to use a PEM(X.509) certificate (stored in a privateKey.pem file on disk) to sign messages.After that i need to verify signature by using certificate (sent to the receiver). Help with this, especially example code in c# and RSA algorithm


回答1:


You may find the Bouncycastle C# library to be of value in your problem. There is a PEMReader class that should be able to read in your PEM file and convert the contents to Bouncycastle cryptography objects. And there is a DotNetUtilities class to provide a bridge between Bouncycastle and .NET cryptography objects.




回答2:


http://msdn.microsoft.com/en-us/library/ms819963.aspx

This is how you can sign message using x509 certificate.



来源:https://stackoverflow.com/questions/3405016/reading-rsa-private-key-in-pem-format-and-reading-public-key-from-certificate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!