Created
May 18, 2015 14:29
-
-
Save tahb/b310feaba98498828e93 to your computer and use it in GitHub Desktop.
Fingerprint for Certificate with OpenSSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cert = OpenSSL::X509::Certificate.new(x) | |
fingerprint = OpenSSL::Digest::SHA1.new(cert.to_der).to_s | |
puts fingerprint.scan(/.{2}/).join(":").upcase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment