Skip to content

Instantly share code, notes, and snippets.

@nahi
Created November 7, 2011 02:32
Show Gist options
  • Save nahi/1344072 to your computer and use it in GitHub Desktop.
Save nahi/1344072 to your computer and use it in GitHub Desktop.
% ruby -ropenssl -e 'p OpenSSL::X509::Certificate.new(File.read("lib/mechanize/test_case.rb")).public_key.e'
1
% ruby -ropenssl -e 'puts OpenSSL::X509::Certificate.new(File.read("lib/mechanize/test_case.rb")).to_text'
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 0 (0x0)
Signature Algorithm: sha1WithRSAEncryption
Issuer: CN=nobody, DC=example
Validity
Not Before: Nov 3 21:08:59 2011 GMT
Not After : Dec 31 12:59:59 9999 GMT
Subject: CN=nobody, DC=example
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (512 bit)
Modulus:
00:f2:99:84:7e:63:f4:21:b8:ab:f7:5c:7a:a5:bb:
6c:e0:99:a6:b1:56:5d:df:1b:c3:e6:9d:f8:ec:41:
6f:04:26:e1:05:6d:67:bf:51:ac:6c:20:44:16:54:
a2:4f:5a:b6:aa:fc:46:6f:92:25:6e:b7:dd:85:d8:
32:a9:d4:d7:51
Exponent: 1 (0x1)
Signature Algorithm: sha1WithRSAEncryption
00:01:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:
ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:00:30:21:30:09:06:05:2b:
0e:03:02:1a:05:00:04:14:78:f8:af:f9:0a:c9:c7:28:ed:10:
93:67:1f:9a:41:f4:e4:d6:22:a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment