SHOW Signed
 

net.rim.device.api.crypto.certificate.wtls
Class WTLSDistinguishedName

java.lang.Object
  |
  +--net.rim.device.api.crypto.certificate.wtls.WTLSDistinguishedName
All Implemented Interfaces:
DistinguishedName, Persistable, Persistable

public final class WTLSDistinguishedName
extends Object
implements DistinguishedName, Persistable

Encapsulates a WTLS identifier, as used in a WTLS certificate, providing easy access to the attributes.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 3.6.0
See Also:
WTLSCertificate

Constructor Summary
 Category: Signed WTLSDistinguishedName(byte[] distinguishedName)
          Creates a WTLSDistinguishedName object from the specified byte array.
 Category: Signed WTLSDistinguishedName(byte[] distinguishedName, int offset, int length)
          Creates a WTLSDistinguishedName object from the specified byte array.
 Category: Signed WTLSDistinguishedName(InputStream in)
          Creates a WTLSDistinguishedName object from the specified input stream.
 
Method Summary
 Category: Signed  boolean equals(Object other)
          Returns true if this WTLSDistinguishedName is equal to other based upon the organizational unit, the organization, and the country.
 Category: Signed  String getCommonName()
          Returns a String containing the commmon name.
 Category: Signed  String getCountry()
          Returns a String containing the country name.
 Category: Signed  String getEmailAddress()
          Retrieve the email attribute associated with this distinguished name.
 Category: Signed  byte[] getEncoding()
          Returns a byte array containing the encoding of this WTLS distinguished name.
 Category: Signed  String getLocality()
          Retrieve the locality attribute associated with this distinguished name.
 Category: Signed  Enumeration getOIDs()
          Returns an Enumeration of all the OIDs present in the identifier attributes.
 Category: Signed  String getOrganization()
          Returns a String containing the organization name.
 Category: Signed  String getOrganizationalUnit()
          Retrieve the organization unit attribute associated with this distinguished name.
 Category: Signed  byte[] getSerialNumber()
          Returns a byte array containing the serial number of the certificate.
 Category: Signed  String getServiceName()
          Returns a string containing the service name (organizational unit).
 Category: Signed  String getStateOrProvince()
          Retrieve the state-or-province attribute associated with this distinguished name.
 Category: Signed  String getString(OID oid)
          Returns the string attribute value associated with the given OID as specified in oid.
 Category: Signed  String getSurname()
          Retrieve the surname attribute associated with this distinguished name.
 Category: Signed  int hashCode()
          Returns a hash code value for the object.
 Category: Signed  boolean isCertificateAuthority()
          Returns true if this certificate is a (non-root) certificate authority's certificate.
 Category: Signed  String toString()
          Returns a string representation of the distinguished name in the order specified by RFC 1779.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WTLSDistinguishedName

public WTLSDistinguishedName(byte[] distinguishedName)
                      throws IOException,
                             CertificateParsingException
Creates a WTLSDistinguishedName object from the specified byte array.

Parameters:
distinguishedName - The byte array containing the encoding of the WTLS distinguished name.
Throws:
IOException - Thrown if an I/O error occurs.
CertificateParsingException - Thrown if a parsing error occurs.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

WTLSDistinguishedName

public WTLSDistinguishedName(byte[] distinguishedName,
                             int offset,
                             int length)
                      throws IOException,
                             CertificateParsingException
Creates a WTLSDistinguishedName object from the specified byte array.

Parameters:
distinguishedName - The byte array containing the encoding of the WTLS distinguished name.
offset - The starting offset of the distinguished name bytes.
length - The length to read into the byte array. This may extend beyond the actual distinguished name.
Throws:
IOException - Thrown if an I/O error occurs.
CertificateParsingException - Thrown if a parsing error occurs.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

WTLSDistinguishedName

public WTLSDistinguishedName(InputStream in)
                      throws IOException,
                             CertificateParsingException
Creates a WTLSDistinguishedName object from the specified input stream.

Parameters:
in - The input stream containing the distinguished name data.
Throws:
IOException - Thrown if an I/O error occurs.
CertificateParsingException - Thrown if a parsing error occurs.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

equals

public boolean equals(Object other)
Returns true if this WTLSDistinguishedName is equal to other based upon the organizational unit, the organization, and the country.
Overrides:
equals in class Object
Since:
JDE 3.6.0

Following copied from class: Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Boolean.hashCode(), Hashtable
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getCommonName

public String getCommonName()
Returns a String containing the commmon name.

Returns:
The common name. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getCountry

public String getCountry()
Returns a String containing the country name.

Returns:
The country name. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getEmailAddress

public String getEmailAddress()
Retrieve the email attribute associated with this distinguished name.

Returns:
A String representing the email address. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getEncoding

public byte[] getEncoding()
Returns a byte array containing the encoding of this WTLS distinguished name.

Returns:
The encoding of the distinguished name or null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getLocality

public String getLocality()
Retrieve the locality attribute associated with this distinguished name.

Returns:
A String representing the locality. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getOIDs

public Enumeration getOIDs()
Returns an Enumeration of all the OIDs present in the identifier attributes.

Returns:
An Enumeration of all the OIDs.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getOrganization

public String getOrganization()
Returns a String containing the organization name.

Returns:
The organization name. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getOrganizationalUnit

public String getOrganizationalUnit()
Retrieve the organization unit attribute associated with this distinguished name.

Returns:
A String representing the name of the organizational unit. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getSerialNumber

public byte[] getSerialNumber()
Returns a byte array containing the serial number of the certificate.

Since the WTLS identifier format is usually text, these bytes are likely a textual representation of the actual serial number.

Returns:
A byte array containing the serial number. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getServiceName

public String getServiceName()
Returns a string containing the service name (organizational unit).

Returns:
A String representing the service name. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getStateOrProvince

public String getStateOrProvince()
Retrieve the state-or-province attribute associated with this distinguished name.

Returns:
A String representing the state or province name. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getString

public String getString(OID oid)
Returns the string attribute value associated with the given OID as specified in oid.

Parameters:
oid - The oid to use to look up the attribute value.
Returns:
The string corresponding to the oid, or null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getSurname

public String getSurname()
Retrieve the surname attribute associated with this distinguished name.

Returns:
A String representing the surname. May be null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the 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.)

Overrides:
hashCode in class Object
Since:
JDE 3.6.0

Following copied from class: Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isCertificateAuthority

public boolean isCertificateAuthority()
Returns true if this certificate is a (non-root) certificate authority's certificate.

For WTLS certificates, this information is contained in the identifier.

Returns:
A boolean representing the Certificate Authority.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

toString

public String toString()
Returns a string representation of the distinguished name in the order specified by RFC 1779.
Specified by:
toString in interface DistinguishedName
Overrides:
toString in class Object
Since:
JDE 3.6.0

Following copied from interface: DistinguishedName
Returns:
A String.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2009 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.