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
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 |
|
WTLSDistinguishedName(byte[] distinguishedName)
Creates a WTLSDistinguishedName object from the specified
byte array. |
|
WTLSDistinguishedName(byte[] distinguishedName,
int offset,
int length)
Creates a WTLSDistinguishedName object from the specified
byte array. |
|
WTLSDistinguishedName(InputStream in)
Creates a WTLSDistinguishedName object from the specified
input stream. |
Method Summary |
|
boolean |
equals(Object other)
Returns true if this WTLSDistinguishedName is equal to
other based upon the organizational unit,
the organization, and the country. |
|
String |
getCommonName()
Returns a String containing the commmon name. |
|
String |
getCountry()
Returns a String containing the country name. |
|
String |
getEmailAddress()
Retrieve the email attribute associated with this
distinguished name. |
|
byte[] |
getEncoding()
Returns a byte array containing the encoding of this WTLS distinguished name. |
|
String |
getLocality()
Retrieve the locality attribute associated with this
distinguished name. |
|
Enumeration |
getOIDs()
Returns an Enumeration of all the OIDs present in the identifier
attributes. |
|
String |
getOrganization()
Returns a String containing the organization name. |
|
String |
getOrganizationalUnit()
Retrieve the organization unit attribute associated with this
distinguished name. |
|
byte[] |
getSerialNumber()
Returns a byte array containing the serial number of the certificate. |
|
String |
getServiceName()
Returns a string containing the service name (organizational unit). |
|
String |
getStateOrProvince()
Retrieve the state-or-province attribute associated with this
distinguished name. |
|
String |
getString(OID oid)
Returns the string attribute value associated with the given OID
as specified in oid . |
|
String |
getSurname()
Retrieve the surname attribute associated with this
distinguished name. |
|
int |
hashCode()
Returns a hash code value for the object. |
|
boolean |
isCertificateAuthority()
Returns true if this certificate is a (non-root) certificate
authority's certificate. |
|
String |
toString()
Returns a string representation of the distinguished name in the
order specified by RFC 1779. |
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
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
OID
s. - 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:
- 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
- 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-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.