Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mozilla.jss.pkix.primitive
Class Name

    java.lang.Object
      |
      +--org.mozilla.jss.pkix.primitive.Name

All Implemented Interfaces:
  ASN1Value

public class Name
extends java.lang.Object
implements ASN1Value

An X.500 Name.

Inner Class Summary
`static class` | `Name.Template`

Field Summary
`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` | `organizationalUnitName` The OID for the organizational unit name (OU) attribute.
`static OBJECT_IDENTIFIER` | `organizationName` The OID for the organization name (O) attribute.
`(package private) SEQUENCE` | `rdns`
`static OBJECT_IDENTIFIER` | `stateOrProvinceName` The OID for the state or province name (S) attribute.
`static Tag` | `TAG`
`private static Name.Template` | `templateInstance`

Constructor Summary
`` | `Name()` Creates an empty Name.
`(package private)` | `Name(SEQUENCE rdns)` Creates a name from a sequence of relative distinguished names.

Method Summary
`void` | `addCommonName(java.lang.String CN)` Adds a common name (CN) to the Name.
`void` | `addCountryName(java.lang.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(java.lang.String L)` Adds a locality name (L) to the Name.
`void` | `addOrganizationalUnitName(java.lang.String OU)` Adds an organizational unit name (OU) to the Name.
`void` | `addOrganizationName(java.lang.String O)` Adds an organization name (O) to the Name.
`void` | `addStateOrProvinceName(java.lang.String S)` Adds a state or province name (S) to the Name.
`private java.lang.String` | `AVAToString(AVA ava)`
`RDN` | `elementAt(int idx)` Returns the RDN at the given index in the Name.
`void` | `encode(java.io.OutputStream ostream)` Write this value's DER encoding to an output stream using its own base tag.
`void` | `encode(Tag implicit, java.io.OutputStream ostream)` Write this value's DER encoding to an output stream using an implicit tag.
`java.lang.String` | `getRFC1485()`
`Tag` | `getTag()` Returns the base tag for this type, not counting any tags that may be imposed on it by its context.
`static Name.Template` | `getTemplate()`
`void` | `insertElementAt(RDN name, int idx)` Inserts the given RDN at the given index in the Name.
`static void` | `main(java.lang.String[] args)`
`void` | `removeElementAt(int idx)` Removes the Name element at the given index.
`int` | `size()` Returns the number of RDNs in the Name.
`private java.lang.String` | `typeToString(OBJECT_IDENTIFIER type)`

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### rdns

    SEQUENCE rdns

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

### stateOrProvinceName

    public static final OBJECT_IDENTIFIER stateOrProvinceName

  The OID for the state or province name (S) 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.

### templateInstance

    private static final Name.Template templateInstance

Constructor Detail

### Name

    public Name()

  Creates an empty Name.

### Name

    Name(SEQUENCE rdns)

  Creates a name from a sequence of relative distinguished names.

Method Detail

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

### insertElementAt

    public void insertElementAt(RDN name,
                                int idx)

  Inserts the given RDN at the given index in the Name.

### elementAt

    public RDN elementAt(int idx)

  Returns the RDN at the given index in the Name.

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

### getTag

    public Tag getTag()

  Description copied from interface: `ASN1Value`
  Returns the base tag for this type, not counting any tags that may be imposed on it by its context.
  Specified by:
    `getTag` in interface `ASN1Value`

### encode

    public void encode(java.io.OutputStream ostream)
                throws java.io.IOException

  Description copied from interface: `ASN1Value`
  Write this value's DER encoding to an output stream using its own base tag.
  Specified by:
    `encode` in interface `ASN1Value`

### encode

    public void encode(Tag implicit,
                       java.io.OutputStream ostream)
                throws java.io.IOException

  Description copied from interface: `ASN1Value`
  Write this value's DER encoding to an output stream using an implicit tag.
  Specified by:
    `encode` in interface `ASN1Value`

### addCommonName

    public void addCommonName(java.lang.String CN)
                       throws java.io.CharConversionException

  Adds a common name (CN) to the Name.

### addCountryName

    public void addCountryName(java.lang.String C)
                        throws java.io.CharConversionException

  Adds a country name (C) to the Name. It must be exactly two characters.
  Throws:
    `java.lang.IllegalArgumentException` - If C.length() != 2.

### addLocalityName

    public void addLocalityName(java.lang.String L)
                         throws java.io.CharConversionException

  Adds a locality name (L) to the Name.

### addStateOrProvinceName

    public void addStateOrProvinceName(java.lang.String S)
                                throws java.io.CharConversionException

  Adds a state or province name (S) to the Name.

### addOrganizationName

    public void addOrganizationName(java.lang.String O)
                             throws java.io.CharConversionException

  Adds an organization name (O) to the Name.

### addOrganizationalUnitName

    public void addOrganizationalUnitName(java.lang.String OU)
                                   throws java.io.CharConversionException

  Adds an organizational unit name (OU) to the Name.

### typeToString

    private java.lang.String typeToString(OBJECT_IDENTIFIER type)

### AVAToString

    private java.lang.String AVAToString(AVA ava)
                                  throws InvalidBERException

### getRFC1485

    public java.lang.String getRFC1485()
                                throws InvalidBERException

### getTemplate

    public static Name.Template getTemplate()

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Tree | Deprecated | Index | Help
| JSS 3.1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD