Skip to content

Instantly share code, notes, and snippets.

@flyerhzm
Created April 10, 2010 14:26
Show Gist options
  • Save flyerhzm/362037 to your computer and use it in GitHub Desktop.
Save flyerhzm/362037 to your computer and use it in GitHub Desktop.
b64 = Base64.b64encode(File::read(cert_file), 64)
pem = "-----BEGIN CERTIFICATE-----\n#{b64}-----END CERTIFICATE-----\n"
cert = OpenSSL::X509::Certificate.new(pem)
public_key = cert.public_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment