Package org.mozilla.jss.pkix.primitive
Class Name
- java.lang.Object
-
- org.mozilla.jss.pkix.primitive.Name
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static className.Template
-
Field Summary
Fields Modifier and Type Field Description static OBJECT_IDENTIFIERcommonNameThe OID for the common name (CN) attribute.static OBJECT_IDENTIFIERcountryNameThe OID for the country name (C) attribute.static OBJECT_IDENTIFIERlocalityNameThe OID for the locality name (L) attribute.static OBJECT_IDENTIFIERorganizationalUnitNameThe OID for the organizational unit name (OU) attribute.static OBJECT_IDENTIFIERorganizationNameThe OID for the organization name (O) attribute.static OBJECT_IDENTIFIERstateOrProvinceNameThe OID for the state or province name (S) attribute.static TagTAG
-
Constructor Summary
Constructors Constructor Description Name()Creates an empty Name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCommonName(java.lang.String CN)Adds a common name (CN) to the Name.voidaddCountryName(java.lang.String C)Adds a country name (C) to the Name.voidaddElement(AVA ava)Adds a relative distinguished name containing a single AVA.voidaddElement(RDN name)Adds a relative distinguished name to the Name.voidaddLocalityName(java.lang.String L)Adds a locality name (L) to the Name.voidaddOrganizationalUnitName(java.lang.String OU)Adds an organizational unit name (OU) to the Name.voidaddOrganizationName(java.lang.String O)Adds an organization name (O) to the Name.voidaddStateOrProvinceName(java.lang.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(java.io.OutputStream ostream)Write this value's DER encoding to an output stream using its own base tag.voidencode(Tag implicit, java.io.OutputStream ostream)Write this value's DER encoding to an output stream using an implicit tag.java.lang.StringgetRFC1485()TaggetTag()Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static Name.TemplategetTemplate()voidinsertElementAt(RDN name, int idx)Inserts the given RDN at the given index in the Name.static voidmain(java.lang.String[] args)voidremoveElementAt(int idx)Removes the Name element at the given index.intsize()Returns the number of RDNs in the Name.
-
-
-
Field Detail
-
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.
-
-
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:ASN1ValueReturns the base tag for this type, not counting any tags that may be imposed on it by its context.
-
encode
public void encode(java.io.OutputStream ostream) throws java.io.IOExceptionDescription copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using its own base tag.
-
encode
public void encode(Tag implicit, java.io.OutputStream ostream) throws java.io.IOException
Description copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using an implicit tag.
-
addCommonName
public void addCommonName(java.lang.String CN) throws java.io.CharConversionExceptionAdds 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.- Throws:
java.io.CharConversionException
-
addCountryName
public void addCountryName(java.lang.String C) throws java.io.CharConversionExceptionAdds 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:
java.lang.IllegalArgumentException- If C.length() != 2.java.io.CharConversionException
-
addLocalityName
public void addLocalityName(java.lang.String L) throws java.io.CharConversionExceptionAdds 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.- Throws:
java.io.CharConversionException
-
addStateOrProvinceName
public void addStateOrProvinceName(java.lang.String S) throws java.io.CharConversionExceptionAdds 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.- Throws:
java.io.CharConversionException
-
addOrganizationName
public void addOrganizationName(java.lang.String O) throws java.io.CharConversionExceptionAdds 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.- Throws:
java.io.CharConversionException
-
addOrganizationalUnitName
public void addOrganizationalUnitName(java.lang.String OU) throws java.io.CharConversionExceptionAdds 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.- Throws:
java.io.CharConversionException
-
getRFC1485
public java.lang.String getRFC1485() throws InvalidBERException- Throws:
InvalidBERException
-
getTemplate
public static Name.Template getTemplate()
-
main
public static void main(java.lang.String[] args)
-
-