Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributeTypeAndValue ¶
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.