Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法使用 C# 从证书中提取公钥?我有一个扩展名为 .crt 的证书文件。
采用:
certificate = new X509Certificate2("server.crt", "secret_password"); byte[] publicKey = certificate.PublicKey.EncodedKeyValue.RawData;
现在“publicKey”字节数组是公钥值的 ASN.1 编码表示。