org.mozilla.jss.pkix.primitive

Class Name

Implemented Interfaces:
ASN1Value

public class Name
extends java.lang.Object
implements ASN1Value

An X.500 Name.

Nested Class Summary

static class
Name.Template

Field Summary

static Tag
TAG
static OBJECT_IDENTIFIER
commonName
The OID for the common name (CN) attribute.
static OBJECT_IDENTIFIER
countryName
The OID for the country name (C) attribute.
static OBJECT_IDENTIFIER
localityName
The OID for the locality name (L) attribute.
static OBJECT_IDENTIFIER
organizationName
The OID for the organization name (O) attribute.
static OBJECT_IDENTIFIER
organizationalUnitName
The OID for the organizational unit name (OU) attribute.
static OBJECT_IDENTIFIER
stateOrProvinceName
The OID for the state or province name (S) attribute.

Constructor Summary

Name()
Creates an empty Name.

Method Summary

void
addCommonName(String CN)
Adds a common name (CN) to the Name.
void
addCountryName(String C)
Adds a country name (C) to the Name.
void
addElement(AVA ava)
Adds a relative distinguished name containing a single AVA.
void
addElement(RDN name)
Adds a relative distinguished name to the Name.
void
addLocalityName(String L)
Adds a locality name (L) to the Name.
void
addOrganizationName(String O)
Adds an organization name (O) to the Name.
void
addOrganizationalUnitName(String OU)
Adds an organizational unit name (OU) to the Name.
void
addStateOrProvinceName(String S)
Adds a state or province name (S) to the Name.
RDN
elementAt(int idx)
Returns the RDN at the given index in the Name.
void
encode(OutputStream ostream)
void
encode(Tag implicit, OutputStream ostream)
String
getRFC1485()
Tag
getTag()
static Name.Template
getTemplate()
void
insertElementAt(RDN name, int idx)
Inserts the given RDN at the given index in the Name.
static void
main(args[] )
void
removeElementAt(int idx)
Removes the Name element at the given index.
int
size()
Returns the number of RDNs in the Name.

Field Details

TAG

public static final Tag TAG

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.

organizationName

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

organizationalUnitName

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

stateOrProvinceName

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

Constructor Details

Name

public Name()
Creates an empty Name.

Method Details

addCommonName

public void addCommonName(String CN)
            throws CharConversionException
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)
            throws CharConversionException
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.

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.

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.

addLocalityName

public void addLocalityName(String L)
            throws CharConversionException
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.

addOrganizationName

public void addOrganizationName(String O)
            throws CharConversionException
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.

addOrganizationalUnitName

public void addOrganizationalUnitName(String OU)
            throws CharConversionException
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.

addStateOrProvinceName

public void addStateOrProvinceName(String S)
            throws CharConversionException
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)
            throws IOException
Specified by:
encode in interface ASN1Value

encode

public void encode(Tag implicit,
                   OutputStream ostream)
            throws IOException
Specified by:
encode in interface ASN1Value

getRFC1485

public String getRFC1485()
            throws InvalidBERException

getTag

public Tag getTag()
Specified by:
getTag in interface ASN1Value

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(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.