org.mozilla.jss.pkix.primitive

Class Name

public class Name extends Object implements ASN1Value

An X.500 Name.
Nested Class Summary
static className.Template
Field Summary
static OBJECT_IDENTIFIERcommonName
The OID for the common name (CN) attribute.
static OBJECT_IDENTIFIERcountryName
The OID for the country name (C) attribute.
static OBJECT_IDENTIFIERlocalityName
The OID for the locality name (L) attribute.
static OBJECT_IDENTIFIERorganizationalUnitName
The OID for the organizational unit name (OU) attribute.
static OBJECT_IDENTIFIERorganizationName
The OID for the organization name (O) attribute.
static OBJECT_IDENTIFIERstateOrProvinceName
The OID for the state or province name (S) attribute.
static TagTAG
Constructor Summary
Name()
Creates an empty Name.
Method Summary
voidaddCommonName(String CN)
Adds a common name (CN) to the Name.
voidaddCountryName(String C)
Adds a country name (C) to the Name.
voidaddElement(RDN name)
Adds a relative distinguished name to the Name.
voidaddElement(AVA ava)
Adds a relative distinguished name containing a single AVA.
voidaddLocalityName(String L)
Adds a locality name (L) to the Name.
voidaddOrganizationalUnitName(String OU)
Adds an organizational unit name (OU) to the Name.
voidaddOrganizationName(String O)
Adds an organization name (O) to the Name.
voidaddStateOrProvinceName(String S)
Adds a state or province name (S) to the Name.
RDNelementAt(int idx)
Returns the RDN at the given index in the Name.
voidencode(OutputStream ostream)
voidencode(Tag implicit, OutputStream ostream)
StringgetRFC1485()
TaggetTag()
static Name.TemplategetTemplate()
voidinsertElementAt(RDN name, int idx)
Inserts the given RDN at the given index in the Name.
static voidmain(String[] args)
voidremoveElementAt(int idx)
Removes the Name element at the given index.
intsize()
Returns the number of RDNs in the Name.

Field Detail

commonName

public static final OBJECT_IDENTIFIER commonName
The OID for the common name (CN) attribute.

countryName

public static final OBJECT_IDENTIFIER countryName
The OID for the country name (C) attribute.

localityName

public static final OBJECT_IDENTIFIER localityName
The OID for the locality name (L) attribute.

organizationalUnitName

public static final OBJECT_IDENTIFIER organizationalUnitName
The OID for the organizational unit name (OU) attribute.

organizationName

public static final OBJECT_IDENTIFIER organizationName
The OID for the organization name (O) attribute.

stateOrProvinceName

public static final OBJECT_IDENTIFIER stateOrProvinceName
The OID for the state or province name (S) attribute.

TAG

public static final Tag TAG

Constructor Detail

Name

public Name()
Creates an empty Name.

Method Detail

addCommonName

public void addCommonName(String CN)
Adds a common name (CN) to the Name.

Parameters: CN The common name. It will be formatted according to the IETF PKIX rules for directory strings.

addCountryName

public void addCountryName(String C)
Adds a country name (C) to the Name. It must be exactly two characters.

Parameters: C The country name. It will be formatted according to the IETF PKIX rules for directory strings.

Throws: IllegalArgumentException If C.length() != 2.

addElement

public void addElement(RDN name)
Adds a relative distinguished name to the Name.

Parameters: name A relative distinguished name (RDN) to be added to the Name.

addElement

public void addElement(AVA ava)
Adds a relative distinguished name containing a single AVA.

Parameters: ava An AttributeValueAssertion, which will be inserted as the sole element of a new RDN, which will be stored in the Name.

addLocalityName

public void addLocalityName(String L)
Adds a locality name (L) to the Name.

Parameters: L The locality name. It will be formatted according to the IETF PKIX rules for directory strings.

addOrganizationalUnitName

public void addOrganizationalUnitName(String OU)
Adds an organizational unit name (OU) to the Name.

Parameters: OU The organizational unit name. It will be formatted according to the IETF PKIX rules for directory strings.

addOrganizationName

public void addOrganizationName(String O)
Adds an organization name (O) to the Name.

Parameters: O The organization name. It will be formatted according to the IETF PKIX rules for directory strings.

addStateOrProvinceName

public void addStateOrProvinceName(String S)
Adds a state or province name (S) to the Name.

Parameters: S The state or province name. It will be formatted according to the IETF PKIX rules for directory strings.

elementAt

public RDN elementAt(int idx)
Returns the RDN at the given index in the Name.

encode

public void encode(OutputStream ostream)

encode

public void encode(Tag implicit, OutputStream ostream)

getRFC1485

public String getRFC1485()

getTag

public Tag getTag()

getTemplate

public static Name.Template getTemplate()

insertElementAt

public void insertElementAt(RDN name, int idx)
Inserts the given RDN at the given index in the Name.

main

public static void main(String[] args)

removeElementAt

public void removeElementAt(int idx)
Removes the Name element at the given index.

size

public int size()
Returns the number of RDNs in the Name.