Modifier and Type | Class and Description |
---|---|
static class |
Name.Template |
Modifier and Type | Field and Description |
---|---|
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.
|
static OBJECT_IDENTIFIER |
stateOrProvinceName
The OID for the state or province name (S) attribute.
|
static Tag |
TAG |
Constructor and Description |
---|
Name()
Creates an empty Name.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
public static final Tag TAG
public static final OBJECT_IDENTIFIER commonName
public static final OBJECT_IDENTIFIER countryName
public static final OBJECT_IDENTIFIER localityName
public static final OBJECT_IDENTIFIER stateOrProvinceName
public static final OBJECT_IDENTIFIER organizationName
public static final OBJECT_IDENTIFIER organizationalUnitName
public void addElement(RDN name)
name
- A relative distinguished name (RDN) to be added to the Name.public void addElement(AVA ava)
ava
- An AttributeValueAssertion, which will be inserted as
the sole element of a new RDN, which will be stored in the Name.public void insertElementAt(RDN name, int idx)
public RDN elementAt(int idx)
public void removeElementAt(int idx)
public int size()
public Tag getTag()
ASN1Value
public void encode(java.io.OutputStream ostream) throws java.io.IOException
ASN1Value
public void encode(Tag implicit, java.io.OutputStream ostream) throws java.io.IOException
ASN1Value
public void addCommonName(java.lang.String CN) throws java.io.CharConversionException
CN
- The common name.
It will be formatted according to the IETF PKIX rules for
directory strings.java.io.CharConversionException
public void addCountryName(java.lang.String C) throws java.io.CharConversionException
C
- The country name.
It will be formatted according to the IETF PKIX rules for
directory strings.java.lang.IllegalArgumentException
- If C.length() != 2.java.io.CharConversionException
public void addLocalityName(java.lang.String L) throws java.io.CharConversionException
L
- The locality name.
It will be formatted according to the IETF PKIX rules for
directory strings.java.io.CharConversionException
public void addStateOrProvinceName(java.lang.String S) throws java.io.CharConversionException
S
- The state or province name.
It will be formatted according to the IETF PKIX rules for
directory strings.java.io.CharConversionException
public void addOrganizationName(java.lang.String O) throws java.io.CharConversionException
O
- The organization name.
It will be formatted according to the IETF PKIX rules for
directory strings.java.io.CharConversionException
public void addOrganizationalUnitName(java.lang.String OU) throws java.io.CharConversionException
OU
- The organizational unit name.
It will be formatted according to the IETF PKIX rules for
directory strings.java.io.CharConversionException
public java.lang.String getRFC1485() throws InvalidBERException
InvalidBERException
public static Name.Template getTemplate()
public static void main(java.lang.String[] args)