|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.crypto.certificate.x509.X509DistinguishedName
Represents the ASN.1 type RDNSequence (Relative Distinguished Name).
The following example illustrates the RDNSequence.
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
RelativeDistinguishedName ::=
SET OF AttributeTypeAndValue
AttributeTypeAndValue ::= SEQUENCE {
attributeType OBJECT IDENTIFIER,
parameters ANY DEFINED BY attributeType }
| Constructor Summary | ||
|
X509DistinguishedName(ASN1InputStream input)
Creates and initializes a distinguished name ( X509DistinguishedName) object.
|
|
|
X509DistinguishedName(byte[] encoding)
Creates and initializes a distinguished name ( X509DistinguishedName) object.
|
|
|
X509DistinguishedName(byte[] encoding,
int offset,
int length)
Creates and initializes a distinguished name ( X509DistinguishedName) object.
|
|
|
X509DistinguishedName(String input)
Creates and initializes a distinguished name ( X509DistinguishedName) object.
|
|
|
X509DistinguishedName(String input,
char delimiter)
Creates and initializes a distinguished name ( X509DistinguishedName) object.
|
|
| Method Summary | ||
|
boolean |
equals(Object obj)
Check that this X509DistinguishedName is equal to obj.
|
|
String |
getCommonName()
Retrieve the common name attribute associated with this distinguished name. |
|
String |
getCountry()
Retrieve the country attribute associated with this distinguished name. |
|
String |
getEmailAddress()
Retrieve the email attribute associated with this distinguished name. |
|
byte[] |
getEncoding()
Returns the encoding of the DistinguishedName. |
|
String |
getLocality()
Retrieve the locality attribute associated with this distinguished name. |
|
Enumeration |
getOIDs()
Returns an enumeration of all the OIDs for the names. |
|
String |
getOrganization()
Retrieve the organization attribute associated with this distinguished name. |
|
String |
getOrganizationalUnit()
Retrieve the organization unit attribute associated with this distinguished name. |
|
String |
getStateOrProvince()
Retrieve the state-or-province attribute associated with this distinguished name. |
|
String |
getString(OID oid)
Retrieve the string associated with this oid. |
|
String |
getSurname()
Retrieve the surname attribute associated with this distinguished name. |
|
int |
hashCode()
Returns a hash code value for the object. |
|
String |
toRFC2253CompatibleString()
Convert this DistinguishedName's internal representation to a standard string format. |
|
String |
toString()
Convert this DistinguishedName's internal representation to a standard string format. |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public X509DistinguishedName(String input) throws ASN1EncodingException
X509DistinguishedName) object.
Note that the input is expected to be represented as a comma-delimited list, such
as CN=Joe Johnson, O=Company X, C=US. No ending character is needed, ie. the list
is assumed to be finished with the last character present in the input string. The recognized data
labels are "CN", "SN", "C", "L", "ST", "O", "OU", and "E". Any other labels will be ignored
and not included in the object. This means they won't be a factor in any .equals or comparison
operations. Also note that the ASN1 encoding of this DN
has the tag and value pairs in the order that they appear in input.
input - An String storing the encoding of the
Distinguished Name, eg "C=Mike, OU=Software, O=RIM". Currently supported strings are:
OIDs.idAtCommonName.
OIDs.idAtSurname.
OIDs.idAtOrganizationalUnitName.
OIDs.idAtOrganizationName.
OIDs.idAtLocalityName.
OIDs.idAtStateOrProvinceName.
OIDs.idAtCountryName.
OIDs.pkcs9_at_emailAddress.
ASN1EncodingException - Thrown if an error occurs reading the input stream.public X509DistinguishedName(String input, char delimiter) throws ASN1EncodingException
X509DistinguishedName) object.
Note that the input is expected to be represented as a delimited list ( delimited by the character delimiter ), such
as CN=Joe Johnson, O=Company X, C=US. No ending character is needed, ie. the list
is assumed to be finished with the last character present in the input string. The recognized data
labels are "CN", "SN", "C", "L", "ST", "O", "OU", and "E". Any other labels will be ignored
and not included in the object. This means they won't be a factor in any .equals or comparison
operations. Also note that the ASN1 encoding of this DN
has the tag and value pairs in the order that they appear in input.
input - An String storing the encoding of the
Distinguished Name, eg "C=Mike delimiter OU=Software code>delimiter O=RIM". Currently supported strings are:
OIDs.idAtCommonName.
OIDs.idAtSurname.
OIDs.idAtOrganizationalUnitName.
OIDs.idAtOrganizationName.
OIDs.idAtLocalityName.
OIDs.idAtStateOrProvinceName.
OIDs.idAtCountryName.
OIDs.pkcs9_at_emailAddress.
delimiter - A character used to seperate each attribute tag/value pair. The most common values are ',' or ';'ASN1EncodingException - Thrown if an error occurs reading the input stream.public X509DistinguishedName(ASN1InputStream input) throws IOException, ASN1EncodingException
X509DistinguishedName) object.
input - An ASN1InputStream storing the encoding of the
Distinguished Name.IOException - Thrown if an I/O error occurs.ASN1EncodingException - Thrown if an error occurs reading the input stream.
public X509DistinguishedName(byte[] encoding)
throws ASN1EncodingException
X509DistinguishedName) object.
encoding - The DER encoding of this object.ASN1EncodingException - Thrown if an error occurs reading the input stream.
public X509DistinguishedName(byte[] encoding,
int offset,
int length)
throws ASN1EncodingException
X509DistinguishedName) object.
encoding - The DER encoding of this object.offset - The offset, or start position, of the data within the array.length - The amount of data to read.ASN1EncodingException - Thrown if an error occurs reading the input stream.| Method Detail |
public byte[] getEncoding()
DistinguishedNamegetEncoding in interface DistinguishedNamepublic boolean equals(Object obj)
obj.
obj equals thispublic String getString(OID oid)
getString in interface DistinguishedNameoid - The oid to look up the string withpublic String getCommonName()
getCommonName in interface DistinguishedNamepublic String getEmailAddress()
Note that this function is for legacy only. X509 v3 defines that an email address should be found in the SubjectAltNames certificate extension.
getEmailAddress in interface DistinguishedNamepublic String getSurname()
getSurname in interface DistinguishedNamepublic String getCountry()
getCountry in interface DistinguishedNamepublic String getLocality()
getLocality in interface DistinguishedNamepublic String getStateOrProvince()
getStateOrProvince in interface DistinguishedNamepublic String getOrganization()
getOrganization in interface DistinguishedNamepublic String getOrganizationalUnit()
getOrganizationalUnit in interface DistinguishedNamepublic Enumeration getOIDs()
getOIDs in interface DistinguishedNameOIDs in this DNpublic String toString()
This method will return the string in RFC2253 compliant format. This method emits the attribute type keywords defined in RFC 2253 (CN, L, ST, O, OU, C, DC). Other additional parameters such as email ("E") which are not defined in RFC 2253 will also be returned if present in the DistinguishedName. Under a strict reading, RFC2253 only specifies a UTF-8 string representation.
Example output would be CN=Joe Johnson;O=Company X;C=US.
toString in interface DistinguishedNametoString in class Objectpublic String toRFC2253CompatibleString()
This method will return the string in RFC2253 compliant format. This method emits the attribute type keywords defined in RFC 2253 (CN, L, ST, O, OU, C, STREET, DC). Any other attributes are not produced as output from this method. Under a strict reading, RFC2253 only specifies a UTF-8 string representation.
Example output would be CN=Joe Johnson;O=Company X;C=US.
public int hashCode()
Objectjava.util.Hashtable.
The general contract of hashCode is:
hashCode method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.