简体   繁体   English

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

[英]How to get the Signature of a Self-Signed Certificate using X509Certificate or other .NET Class?

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. 我通过在sslStream类上使用RemoteCertificateValidation回调获取远程证书。

The certificate is given as a X509Certificate class, I can get all properties of this certificate using this class except the Signature. 该证书以X509Certificate类的形式提供,我可以使用该类获取所有证书的属性(签名除外)。

Is there any way I can get the byte array of the signature using the X509Certificate class or any other class? 有什么办法可以使用X509Certificate类或任何其他类获取签名的字节数组?

Regards Albert 关于阿尔伯特

If you don't mind using third-party components, take a look at PKIBlackbox package of our SecureBlackbox product. 如果您不介意使用第三方组件,请查看我们的SecureBlackbox产品的PKIBlackbox软件包。 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. 使用TElX509Certificate类,您可以验证证书(使用内部Validate方法)并计算证书的哈希值,以便通过几行代码将它们与已知值进行比较。

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

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