Search code examples
sslcryptographycertificatersax509

Is it possible to recover certificate thumbprint (sha1 fingerprint) from private key material?


Is it possible to recover certificate thumbprint (sha1 fingerprint) only from private key that will match original certificate thumbprint?

I can not find any information about how thumbprints are generated.

Private key material: I have a .PFX file with single certificate and it's private key. From .PFX I export only private key:

openssl rsa -inform p12 -in cert.pfx -outform der -out cert.key.der


Solution

  • It is not possible to get a certificate fingerprint from the private key only. The private key matches only the public key in the certificate. There can actually be multiple certificates using the same public and private key, all having different certificate fingerprints. This is not uncommon - certificate renewals often use the same key pair as the previous (expired) certificate.

    What would be possible is to get the public key fingerprint, but not the certificate fingerprint.