OpenSSL::X509::Certificate
class OpenSSL::X509::Certificate
Implementation of an X.509 certificate as specified in RFC 5280. Provides access to a certificate's attributes and allows certificates to be read from a string, but also supports the creation of new certificates from scratch.
Reading a certificate from a file
Certificate is capable of handling DER-encoded certificates and certificates encoded in OpenSSL's PEM format.
raw = File.read "cert.cer" # DER- or PEM-encoded certificate = OpenSSL::X509::Certificate.new raw