X509.Distinguished_nameX.500 distinguished name
module Encoded_string : sig ... endASN.1 string contents and encoding.
module type Attribute_value = sig ... endAttribute values with encoding-specific constructors. String repertoires and attribute-specific length bounds are not checked.
module Common_name :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for common name.
module Serial_number : Attribute_value with type encoding = [ `Printable ]The module type for serial number.
module Country_name : Attribute_value with type encoding = [ `Printable ]The module type for country name.
module Locality_name :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for locality name.
module State_or_province_name :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for state or province name.
module Organization_name :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for organization name.
module Organizational_unit_name :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for organization unit name.
module Title :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for title.
module Email_address : Attribute_value with type encoding = [ `IA5 ]The module type for email address.
module Personal_name :
Attribute_value with type encoding = Encoded_string.directory_encodingValues used by givenName, surname, initials and generationQualifier.
module Pseudonym :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for pseudonym.
module Street_address :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for street address.
module User_id :
Attribute_value with type encoding = Encoded_string.directory_encodingThe module type for user id.
module Other_attribute : sig ... endAttributes whose OIDs have no named constructor.
type attribute = | CN of Common_name.t| Serialnumber of Serial_number.t| C of Country_name.t| L of Locality_name.t| ST of State_or_province_name.t| O of Organization_name.t| OU of Organizational_unit_name.t| T of Title.t| DNQ of [ `Printable ] Encoded_string.t| Mail of Email_address.t| DC of [ `IA5 ] Encoded_string.t| Given_name of Personal_name.t| Surname of Personal_name.t| Initials of Personal_name.t| Pseudonym of Pseudonym.t| Generation of Personal_name.t| Street of Street_address.t| Userid of User_id.t| Other of Other_attribute.tAn X.500 attribute type and value.
A set of attributes. String encodings participate in comparison.
A distinguished name is a list of relative distinguished names, starting with the most significant component.
equal a b compares the stored RDN sequences, including the string encodings and content octets of their attributes.
matches a b compares names using a restricted byte-based matching rule. Attribute types, RDN order and stored attribute counts must agree. For known DirectoryString attributes, PrintableString and UTF8String values with identical content octets match. Other encodings and unknown attributes require identical string tags and content octets.
This does not implement the StringPrep processing of RFC 5280 section 7.1: no case folding, whitespace normalization or transcoding is performed.
val make_pp :
format:[ `RFC4514 | `OpenSSL | `OSF ] ->
?spacing:[ `Tight | `Medium | `Loose ] ->
unit ->
t Fmt.tmake_pp () creates a customized pretty-printer for t.
`Tight to not add any redundant space,`Medium to add space after comma and around plus signs, and`Loose to also add space around equality signs.This parameter is currently ignored for the OSF format.
The pretty-printer can be wrapped in a box to control line breaking and set it apart, otherwise the RDN components will flow with the surrounding text. String contents are not transcoded, and encoding tags are omitted.
val pp : t Fmt.tpp ppf dn pretty-prints the distinguished name. This is currently Fmt.hbox (make_pp ~format:`OSF ()). If your application relies on the precise format, it is advicable to create a custom formatter with make_pp to guard against future changes to the default format.
val common_name : t -> Common_name.t optioncommon_name t is a CN value from the most specific RDN containing one, or None if t has no CN.
val decode_der : string -> (t, [> `Msg of string ]) Stdlib.resultdecode_der cs is dn, the ASN.1 decoded distinguished name of cs. Known attributes must use their permitted string types. String contents are decoded using the ASN.1 string primitives, without additional repertoire or character-count checks.
val encode_der : t -> stringencode_der dn is octets, the ASN.1 encoded representation of the distinguished name dn. String encodings and content octets are preserved.