获取X509的IssuerNameHash和IssuerKeyHash
我需要从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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论