Skip to content

NameObject

Convenience object form of an X.501 distinguished name.

Populated fields are emitted in the order defined by NAME_OBJECT_ORDER.
Each populated field becomes its own single-attribute RDN.

For caller-controlled ordering, pass a NameAttribute array to encodeName.
For multi-valued RDNs, use encodeRelativeDistinguishedName.

ts
interface NameObject {
	readonly commonName?: string;
	readonly surname?: string;
	readonly serialNumber?: string;
	readonly country?: string;
	readonly locality?: string;
	readonly state?: string;
	readonly street?: string;
	readonly organization?: string;
	readonly organizationalUnit?: string;
	readonly title?: string;
	readonly givenName?: string;
	readonly emailAddress?: string;
}

Properties

  • readonly commonName?: string — Subject or issuer common name (CN).
  • readonly surname?: string — Subject surname (SN).
  • readonly serialNumber?: string — Device or entity serial number — not the certificate serial.
  • readonly country?: string — ISO 3166 two-letter country code (C). Must be exactly 2 characters.
  • readonly locality?: string — City or locality (L).
  • readonly state?: string — State or province (ST).
  • readonly street?: string — Street address.
  • readonly organization?: string — Organization name (O).
  • readonly organizationalUnit?: string — Organizational unit (OU). Deprecated in modern CA practice.
  • readonly title?: string — Job title or functional designation.
  • readonly givenName?: string — First / given name (GN).
  • readonly emailAddress?: string — RFC 822 email address. Encoded as IA5String, not UTF-8.

Released under the MIT License.