'Get issuerNameHash and issuerKeyHash of x509
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: https://crypto.stackexchange.com/questions/87661/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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
