Search code examples
c++certificatecertificate-authority

Look up leaf certificate from issuer’s thumbprint?


I have a leaf certificate installed on my machine, which was issued by a Certificate Authority (CA); this CA is not present on the system.

If I am given the thumbprint (i.e. the SHA-1 hash) of the CA, can I look up and thereby retrieve the installed leaf signers issued by this CA? If I am able to, then what are the required Windows function calls for accomplishing this?

I have been examining a leaf certificate and I only see the standard string representation name of the CA and not a thumbprint. This string name is not unique, hence why I am utilizing the thumbprint (SHA-1’s poor security here is not a problem as it is only used for looking up a proper signer). Microsoft has the CertGetIssuerCertificateFromStore function, but this requires having the CA in memory.


Solution

  • No, it is not possible to look up an issued leaf signer using only the issuer's CA's thumbprint. You first have to install the CA on the machine and then use the entirety of the CA to find its issued leaf signers. The CA's thumbprint is not stored in the leaf signers it issues from what it appears.

    All in all, the first operation that needs to be done is installing the CA on the machine you want to find its issued leaf signers on.