Skip to content
class method

OpenSSL::X509::Certificate.load

(::String filename, ?::Module | bool) -> bool
OpenSSL::X509::Certificate.load(string) → [certs...]
OpenSSL::X509::Certificate.load(file) → [certs...]

Read the chained certificates from the given input. Supports both PEM and DER encoded certificates.

PEM is a text format and supports more than one certificate.

DER is a binary format and only supports one certificate.

If the file is empty, or contains only unrelated data, an OpenSSL::X509::CertificateError exception will be raised.

See also .load_file .new also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1