Beryl::Certificates::Certificate
An X.509 certificate (RFC 5280 §4.1), read from DER.
certificate = Beryl::Certificates::Certificate.new(der_bytes)
certificate.subject.to_s # => "CN=example.com"
certificate.list_of_dns_names # => ["example.com"]
certificate.not_after # => 2027-01-01 00:00:00 UTC
Reading checks the whole structure strictly (DER, every field of the
signed part, the contents of every extension Beryl knows, no extension
twice, the signature algorithm equal inside and outside the signed
part) and raises MalformedCertificate on any violation. Whether the
certificate may be used for anything is the job of ChainVerification.
Constants
The extension identifiers Beryl reads and acts on, or knows to be safe to accept when marked critical: a critical extension outside this set makes the certificate unusable (RFC 5280 §4.2).
Constructors
Class methods
Instance methods
The number of access descriptions in the authority information access
extension, or nil without one.
The extension with identifier, or nil.
Returns whether an extension marked critical is outside
LIST_OF_UNDERSTOOD_EXTENSIONS.
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Returns whether the subject and issuer names are the same (RFC 5280 §6.1: a self-issued certificate).
Returns whether issuer_key verifies this certificate's signature.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Returns whether time is within notBefore and notAfter, both inclusive (RFC 5280 §4.1.2.5). Fractions of a second in time are dropped first, since certificate times have whole seconds.