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

java.lang.Object
  extended by net.rim.device.api.crypto.certificate.wtls.WTLSDistinguishedName
All Implemented Interfaces:
DistinguishedName, 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.

See Also:
WTLSCertificate
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:
BlackBerry API 3.6.0

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.
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:
BlackBerry API 3.6.0

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.
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:
BlackBerry API 3.6.0

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.
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:
BlackBerry API 3.6.0


Method Detail

getEncoding

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

Specified by:
getEncoding in interface DistinguishedName
Returns:
The encoding of the distinguished name or null.
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:
BlackBerry API 3.6.0

getString

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

Specified by:
getString in interface DistinguishedName
Parameters:
oid - The oid to use to look up the attribute value.
Returns:
The string corresponding to the oid, or null.
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:
BlackBerry API 3.6.0

getEmailAddress

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

Specified by:
getEmailAddress in interface DistinguishedName
Returns:
A String representing the email address. May be null.
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:
BlackBerry API 3.6.0

getSurname

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

Specified by:
getSurname in interface DistinguishedName
Returns:
A String representing the surname. May be null.
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:
BlackBerry API 3.6.0

getLocality

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

Specified by:
getLocality in interface DistinguishedName
Returns:
A String representing the locality. May be null.
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:
BlackBerry API 3.6.0

getStateOrProvince

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

Specified by:
getStateOrProvince in interface DistinguishedName
Returns:
A String representing the state or province name. May be null.
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:
BlackBerry API 3.6.0

getOrganizationalUnit

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

Specified by:
getOrganizationalUnit in interface DistinguishedName
Returns:
A String representing the name of the organizational unit. May be null.
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:
BlackBerry API 3.6.0

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
Returns:
a string representation of the object.
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:
BlackBerry API 3.6.0

getOIDs

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

Specified by:
getOIDs in interface DistinguishedName
Returns:
An Enumeration of all the OIDs.
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:
BlackBerry API 3.6.0

getServiceName

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

Returns:
A String representing the service name. May be null.
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:
BlackBerry API 3.6.0

getOrganization

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

Specified by:
getOrganization in interface DistinguishedName
Returns:
The organization name. May be null.
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:
BlackBerry API 3.6.0

getCountry

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

Specified by:
getCountry in interface DistinguishedName
Returns:
The country name. May be null.
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:
BlackBerry API 3.6.0

getCommonName

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

Specified by:
getCommonName in interface DistinguishedName
Returns:
The common name. May be null.
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:
BlackBerry API 3.6.0

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.
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:
BlackBerry API 3.6.0

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.
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:
BlackBerry API 3.6.0

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:

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
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.
Since:
BlackBerry API 3.6.0

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
Parameters:
other - 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.
Since:
BlackBerry API 3.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal