Skip to content

distinguishedNameToString ​

distinguishedNameToString ​

Renders a ParsedName as an RFC 4514 distinguished name string, e.g. CN=Example CA,O=Acme,C=US.

RDNs are emitted in reverse encoding order and multi-valued RDNs are joined with +, both per RFC 4514 §2. Attribute types outside the RFC 4514 §3 keyword table use the short names openssl prints, falling back to the dotted OID.

ts
function distinguishedNameToString(
	name: ParsedName,
): string

Parameters

Examples

ts
distinguishedNameToString(parsed.subject); // 'CN=example.com,O=Acme\\, Inc.,C=US'

Released under the MIT License.