How to get the finger print of x509 Certificate #34
Unanswered
divya-clari
asked this question in
General
Replies: 2 comments
-
You can compute the thumbprint using the https://peculiarventures.github.io/x509/classes/X509Certificate.html#getThumbprint NodeJS const cert = new x509.X509Certificate(pem);
const thumbprint = await cert.getThumbprint();
const formattedThumbprint: string[] = [];
for (const octet of Buffer.from(thumbprint)) {
formattedThumbprint.push(`${octet.toString(16)}`.padStart(2, "0").toUpperCase());
}
console.log(formattedThumbprint.join(":")); // 10:B9:24:B0:18:57:23:F2:2D:EB:FD:94:37:55:85:E9:CF:1D:8B:93 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am looking for a way to get the fingerprint of X509 Certificate. IS there an example that i can follow ? To give little bit more context we are migrating a legacy module from Rails. So Trying to achieve the same thing as below:
fingerprint=OpenSSL::Digest::SHA1.new(Base64.decode64(x509Certificate)).to_s.scan(/../).map{ |s| s.upcase }.join(":")
Expected FingerPrint pattern: "10A:12B:1A:C8...........:97"
Beta Was this translation helpful? Give feedback.
All reactions