如何在 C# 中从 pvk 文件读取私钥?
我必须读取一个私钥,该密钥是 pvk 格式的。我使用 X509Certificate2 类,但在这个类中我只有公钥访问权限。 如何从 pvk 文件中获取私钥?
I have to read a private key, and this key is on pvk format. I use X509Certificate2 class, but i this class i have only public key access.
How can I get a private key from pvk file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Luiz,您需要将 CER 和 PVK 合并到一个 PFX 文件中,然后将该文件作为证书导入,这样当您加载 X509Cert 时,私钥就会在那里。请参阅使用 PrivateKey X.509 证书解密。
Luiz, you need to combine the CER and PVK into a single PFX file, then import the file as a cert so that when you load the X509Cert the PrivateKey will be there. See Decrypt with PrivateKey X.509 Certificate.
http://msdn.microsoft。 com/en-us/library/system.security.cryptography.x509certificates.x509certificate2.privatekey.aspx
这个怎么样?
请记住:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate2.privatekey.aspx
How about this ?
Have in mind:
您可以使用此命令将它们组合起来。
使用 PrivateKey X.509 证书解密
You can use this command to combine them.
Decrypt with PrivateKey X.509 Certificate