如何使用 X509Certificate 或其他 .NET 类获取自签名证书的签名?

发布于 2024-09-01 03:16:40 字数 257 浏览 1 评论 0原文

我试图通过尝试使用已知/可信的公钥解密签名来验证根/自签名证书,然后检查解密的哈希值是否与原始证书哈希值匹配。

我通过在 sslStream 类上使用 RemoteCertificateValidation 回调来获取远程证书。

该证书作为 X509Certificate 类给出,我可以使用此类获取该证书的所有属性(签名除外)。

有什么方法可以使用 X509Certificate 类或任何其他类获取签名的字节数组吗?

问候 阿尔伯特

I am trying to verify a root/self-signed certificate by trying to decrypt the signature with a known/trusted Public Key, then checking if the decrypted hash matches the original certificate hash.

I get the remote certificate by using RemoteCertificateValidation callback on the sslStream class.

The certificate is given as a X509Certificate class, I can get all properties of this certificate using this class except the Signature.

Is there any way I can get the byte array of the signature using the X509Certificate class or any other class?

Regards
Albert

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事↓在人 2024-09-08 03:16:40

如果您不介意使用第三方组件,请查看 PKIBlackbox 我们的 SecureBlackbox 产品包。使用 TElX509Certificate 类,您可以验证证书(使用内部 Validate 方法)并计算证书的哈希值,以便通过几行代码将它们与已知值进行比较。

If you don't mind using third-party components, take a look at PKIBlackbox package of our SecureBlackbox product. Using TElX509Certificate class you can validate the certificate (using internal Validate method) and compute the hashes of your certificate in order to compare them to known values with a couple of lines of code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文