The Principal interface method {@link #getName getName} returns the encodedname in little-endian format in accordance with RFC2253 and the IANA assigned numbers document for Directory System Names.
If the Name is initalised with a RFC2253 conformant syntax then the attributes are encoded in the opposite order they appear in the name(in little-endian order).
If the Name is initialized by decoding a DER stream then the internal representation remains identical to the decoded data. In other words, decoding and subsequent encoding of a Name object retains the order of attributes and returns identical encodings.
Note: this class works properly only if the {@link #decode decode}method is called in order to decode Names. Do not use constructions such as:
DERDecoder dec; Name rdn; dec = new DERDecoder(in); rdn = new Name(); dec.readCollectionOf(rdn); dec.close();
This would work in theory but this implementation makes some assumptions in order to optimise the decoding. Better use the "proper" construction: DERDecoder dec; Name rdn; dec = new DERDecoder(in); rdn = new Name(); rdn.decode(dec); dec.close();
This should always be safe and is the preferred way of decoding ASN.1 types anyway. Since there is only one choice at present for the Name which is RDNSequence this type does not bother to implement CHOICE as its outer type. The definition of Name according to X.501 as given in RSA Laboratories' Laymans Guide is:
Name ::= CHOICE { RDNSequence } RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RelativeDistinguishedName :: = SET OF AttributeValueAssertion AttributeValueAssertion ::= SEQUENCE { AttributeType, AttributeValue } AttributeType ::= OBJECT IDENTIFIER AttributeValue ::= ANY Since the ANY type is deprecated in the '97 specification of X.680 we represent the ANY type by a generic Open Type which is the new ASN.1 way of handling this.This class supports the full range of RFC2253 features including
The string output is canonicalized. Everything that can be resolved by this class (e.g., keywords for attribute types) is resolved. The following attribute types are supported per default (cf. RFC3383:
- Quoting and escaping.
- RDNs with multiple AVAs separated by a plus sign ('+').
- OIDs as attribute keys.
- Hexadecimal attribute values introduced by a '#'. Such values must constitute a valid BER encoding.
- Commas and semicolons as separators.
@author Volker Roth @author Jan Peters @version "$Id: Name.java,v 1.9 2007/08/30 08:45:05 pebinger Exp $"
- ALIASEDOBJECTNAME (aliasedObjectName, 2.5.4.1, RFC2256)
- C (countryName, 2.5.4.6, RFC2256)
- CN (commonName, 2.5.4.3, RFC2256)
- DC (domainComponent, 0.9.2342.19200300.100.1.25, RFC2247)
- DATEOFBIRTH (dateOfBirth, 1.3.6.1.5.5.7.9.1, RFC2985)
- DNQUALIFIER (dnQualifier, 2.5.4.46, RFC2256)
- DESCRIPTION (description, 2.5.4.13, RFC2256)
- EMAILADDRESS (emailAddress, 1.2.840.113549.1.9.1, RFC2985)
- GENDER (gender, 1.3.6.1.5.5.7.9.3, RFC2985)
- GENERATION (generationQualifier, 2.5.4.44, RFC2256)
- GN (givenName, 2.5.4.42, RFC2256)
- INITIALS (initials, 2.5.4.43, RFC2256)
- IP (ip, 1.3.6.1.4.1.42.2.11.2.1, ?)
- L (localityName, 2.5.4.7, RFC2256)
- O (organizationName, 2.5.4.10, RFC2256)
- OU (organizationalUnitName, 2.5.4.11, RFC2256)
- PLACEOFBIRTH (placeOfBirth, 1.3.6.1.5.5.7.9.2, RFC2985)
- POSTALADDRESS (postalAddress, 2.5.4.16, RFC2256)
- POSTALCODE (postalCode, 2.5.4.17, RFC2256
- PSEUDONYM (pseudonym, 2.5.4.65, RFC2985)
- SERIALNUMBER (serialNumber, 2.5.4.5, RFC2256)
- SN (surName, 2.5.4.4, RFC2256)
- ST (stateOrProvinceName, 2.5.4.8, RFC2256)
- STREET (street, 2.5.4.9, RFC2256)
- UID (uid, 0.9.2342.19200300.100.1.1, RFC2253)
- TITLE (title, 2.5.4.12, RFC2256)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|