Documentation ¶
Overview ¶
Copyright (c) 2011-2015 Michael Mitton (mmitton@gmail.com) Portions copyright (c) 2015-2016 go-ldap Authors
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttributeTypeAndValue ¶
type AttributeTypeAndValue struct { // Type is the attribute type Type string // Value is the attribute value Value string }
AttributeTypeAndValue represents an attributeTypeAndValue from https://tools.ietf.org/html/rfc4514
func (*AttributeTypeAndValue) Equal ¶
func (a *AttributeTypeAndValue) Equal(other *AttributeTypeAndValue) bool
Equal returns true if the AttributeTypeAndValue is equivalent to the specified AttributeTypeAndValue Case of the attribute type is not significant
type DN ¶
type DN struct {
RDNs []*RelativeDN
}
DN represents a distinguishedName from https://tools.ietf.org/html/rfc4514
func FromCertSubject ¶
FromCertSubject takes a pkix.Name from a cert and returns a DN that uses the same set. Does not support multi value RDNs.
func FromRawCertSubject ¶ added in v2.2.0
FromRawCertSubject takes a raw subject from a certificate and uses asn1.Unmarshal to get the individual RDNs in the original order, including multi-value RDNs.
func ParseDN ¶
ParseDN returns a distinguishedName or an error. The function respects https://tools.ietf.org/html/rfc4514
func (*DN) AncestorOf ¶
AncestorOf returns true if the other DN consists of at least one RDN followed by all the RDNs of the current DN. "ou=widgets,o=acme.com" is an ancestor of "ou=sprockets,ou=widgets,o=acme.com" "ou=widgets,o=acme.com" is not an ancestor of "ou=sprockets,ou=widgets,o=foo.com" "ou=widgets,o=acme.com" is not an ancestor of "ou=widgets,o=acme.com"
type RelativeDN ¶
type RelativeDN struct {
Attributes []*AttributeTypeAndValue
}
RelativeDN represents a relativeDistinguishedName from https://tools.ietf.org/html/rfc4514
func (*RelativeDN) Equal ¶
func (r *RelativeDN) Equal(other *RelativeDN) bool
Equal returns true if the RelativeDNs are equal as defined by rfc4517 4.2.15 (distinguishedNameMatch). Relative distinguished names are the same if and only if they have the same number of AttributeTypeAndValues and each attribute of the first RDN is the same as the attribute of the second RDN with the same attribute type. The order of attributes is not significant. Case of attribute types is not significant.