internal

package
v1.15.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeTypeAndValue

type AttributeTypeAndValue struct {
	Type  string
	Value any
}

type RelativeDN

type RelativeDN struct {
	Attributes []AttributeTypeAndValue
}

func ParseDN

func ParseDN(str string) ([]RelativeDN, error)

ParseDN parses a string representation of a Distinguished Name (DN) into a slice of RelativeDNs. The input string should be in the format of a DN as defined in RFC 4514 and RFC 2253. The input string is split into Relative Distinguished Names (RDNs) by the ',' or ';' character. Each RDN is then split into AttributeType and AttributeValue pairs by the '=' character. Multiple Attributes in an RDN are separated by the '+' character. The input string may contain escaped characters using the '\' character. The following characters can be escaped: ' ', '"', '#', '+', ',', ';', '<', '=', '>', and '\'. The escaped character is removed and the following character is treated as a literal. If the input string contains hex-encoded characters of the form '\XX' where XX is a two-character hexadecimal number, the hex-encoded character is replaced with the decoded character. If the value of an AttributeValue starts with a '#' character, the value is assumed to be hex-encoded asn1 DER and is decoded before being added to the RelativeDN.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL