读取PEM格式的RSA私钥并从证书中读取公钥 [英] Reading RSA Private Key in PEM format And Reading public Key from certificate
问题描述
我正在尝试使用PEM(X.509)证书(存储在磁盘上的privateKey.pem文件中)对邮件进行签名。此后,我需要使用证书(发送给接收方)来验证签名。
帮助解决此问题,尤其是c#和RSA算法中的示例代码
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
推荐答案
您可能会找到 Bouncycastle C#库对于解决您的问题很有价值。有一个PEMReader类应该能够读取您的PEM文件并将其内容转换为Bouncycastle加密对象。还有一个DotNetUtilities类可以在Bouncycastle和.NET加密对象之间建立桥梁。
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.
这篇关于读取PEM格式的RSA私钥并从证书中读取公钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!