struct

Beryl::Certificates::DistinguishedName

Inherits Struct < Value < Object

An X.501 distinguished name (RFC 5280 §4.1.2.4): a sequence of relative distinguished names, each a set of attribute type and value pairs.

Names are compared byte for byte on their encoding, as Go, rustls-webpki and BoringSSL compare issuer and subject when building paths; the RFC 4518 string preparation that RFC 5280 §7.1 describes is not applied.

Constructors

new(encoded : Bytes, list_of_relative_names : Array(Array(Attribute)))
Source
read(reader : Encoding::DER::Reader) : DistinguishedName

Reads a Name from reader.

Source

Class methods

malformed_value_reason(value : Encoding::DER::Element) : String | Nil

Why value cannot be an attribute value, or nil when it can. A value is a UTF8String, PrintableString, TeletexString, IA5String, NumericString, UniversalString or BMPString with contents that type allows, a BIT STRING (x500UniqueIdentifier) or a SEQUENCE: the types OpenSSL accepts in names. RFC 5280 declares AttributeValue as ANY, but every other type is refused so that a name means the same here as in other verifiers.

Source

Instance methods

==(other : DistinguishedName) : Bool
Source
empty?
Source
encoded

The whole encoding, the SEQUENCE included.

Source
hash(hasher)

See Object#hash(hasher)

Source
list_of_common_names

The common name values (2.5.4.3) as bytes.

Source
list_of_relative_names
Source
list_of_values(type : Encoding::DER::ObjectIdentifier) : Array(Attribute)

Every attribute of type type, in order.

Source
starts_with?(prefix : DistinguishedName) : Bool

Returns whether this name begins with every relative distinguished name of prefix, in order: the test a directoryName name constraint applies (RFC 5280 §4.2.1.10). Each relative name is compared on its encoding.

Source
to_s(io : IO) : Nil

A readable form such as "CN=example.com, O=Example", for messages.

Source

Nested types