获取X509的IssuerNameHash和IssuerKeyHash

发布于 2025-01-30 06:10:20 字数 674 浏览 5 评论 0原文

我需要从X509 CA证书中获取以下内容:

  • DER编码的公共密钥(不包括标签和长度)的主题公共密钥字段的哈希
  • 发行者的哈希德(Hash)杰出的名称,必须在编码的DER编码上计算出 。 issuer's name field

I tried to use X509_issuer_name_hash and X509_pubkey_digest , but apparently they return not the results that I expect.

这个问题和发布的答案接近我要寻找的内容:我如何从PEM或DER证书中获得InsuerNameHash和IssuerKeyHash?,但是我想对如何在C ++和OpenSSL中进行此操作。

更新: x509_pubkey_digest正是我所需要的,我只是犯了一个错误转换为hexstring的错误。发行人的杰出名称的哈希仍然是打开的。

I need to get the following out of x509 CA certificates:

  • the Hash of the DER encoded public key (excluding tag and length) of the subject public key field
  • the hash of the issuers distinguished name, that must be calculated over the DER encoding of the issuer's name field

I tried to use X509_issuer_name_hash and X509_pubkey_digest , but apparently they return not the results that I expect.

This question and the answers posted is close to what I look for: How can I get issuerNameHash and issuerKeyHash from PEM or DER certificates? but I would like to have an explanation on how to do this in C++ and OpenSSL.

UPDATE: X509_pubkey_digest is exactly what i needed, I just made a mistake converting to hexstring. The hash of the issuer's distinguished name is still open though.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文