简体   繁体   English

如何将公共.pem dsa密钥导入C#代码?

[英]How to I import public .pem dsa key into c# code?

I'm trying to import a public DSA key in .pem format, generated by openssl into c# code to verify signatures using DSACryptoServiceProvider. 我正在尝试将由openssl生成的.pem格式的公共DSA密钥导入到c#代码中,以使用DSACryptoServiceProvider验证签名。

How do I do that? 我怎么做?

You can create an x509Certificate2 from a PEM source (there are constructors that take a string filename). 您可以从PEM源创建x509Certificate2(有些构造函数采用字符串文件名)。 At that point, you should be able to use that with the crypto provider. 那时,您应该可以将其与加密提供程序一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM