net.rim.device.api.crypto.certificate
Interface Certificate

All Superinterfaces:
Persistable, Persistable
All Known Implementing Classes:
WTLSCertificate, X509Certificate

public interface Certificate
extends Persistable

Defines the properties of all certificates. A certificate is a collection of data used to associate a public key with an identity.

See Also:
CertificateStatus, CertificateField, CertificateFactory
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

Field Summary
Category: Signed static long DISPLAY_CA
          The identifier to indicate the extraction of the information on whether to display the CA certificate state or not.
Category: Signed static long DISPLAY_ROOT
          The identifier to indicate the extraction of the information on whether to display the root certificate state or not.
Category: Signed static long EMAIL_ADDRESSES
          The identifier to indicate the extraction of email addresses from the certificate.
Category: Signed static long IS_END_ENTITY
          The identifier to indicate whether or not this certificate is an end entity certificate.
Category: Signed static long PROMPT_TO_TRUST_ON_IMPORT
          The identifier to indicate whether or not this certificate should be added to the trusted key store on import based on some qualities that are specific to the certificate itself.
Category: Signed static long PUBLIC_KEY_ALGORITHM_INFORMATION
          The identifier to indicate the extraction of the public key algorithm information from the certificate.
Category: Signed static long SUMMARY_TEXT
          The identifier to retrieve summary text which describes the certificate.
 
Method Summary
Category: Signed  void checkCertificateChain(int position, Certificate[] chain)
          Checks to make sure that the certificate at position is valid within the chain.
Category: Signed  CertificateDisplayField[] getCustomDisplayFields()
          Returns custom information about the certificate for display in a dialog.
Category: Signed  byte[] getEncoding()
          Returns the encoding of the certificate.
Category: Signed  byte[] getEncoding(int field)
          Returns the encoding of the field within the certificate (see CertificateField).
Category: Signed  CertificateExtension getExtension(OID oid)
          Returns the extension for the given oid if it exists in the certificate, otherwise null.
Category: Signed  CertificateExtension[] getExtensions()
          Returns all the extensions associated with this certificate, or null.
Category: Signed  CertificateExtension[] getExtensions(boolean criticalBit)
          Returns all the extensions associated with this certificate that have their critical bit set to the value of criticalBit, or null if none are found.
Category: Signed  Object getInformation(long id, Object param, Object defaultValue)
          Retrieves generic information about the certificate
Category: Signed  DistinguishedName getIssuer()
          Returns a DistinguishedName object, representing the issuer of this certificate.
Category: Signed  long getNotAfter()
          Returns the date on which this certificate will expire.
Category: Signed  long getNotBefore()
          Returns the date on which this certificate will become valid.
Category: Signed  PublicKey getPublicKey()
          Extracts the subject's public key.
Category: Signed  String getPublicKeyAlgorithm()
          Returns a string representing the intended use of the public key.
Category: Signed  byte[] getSerialNumber()
          Returns the certificates serial number as a byte array representing an an integer in big-endian (network) order.
Category: Signed  String getSignatureAlgorithm()
          Returns a string representing the signature algorithm used to sign this certificate.
Category: Signed  CertificateStatus getStatus()
          Retrieves the CertificateStatus for this certificate object
Category: Signed  DistinguishedName getSubject()
          Returns a DistinguishedName object, representing the subject name of this certificate.
Category: Signed  String getSubjectFriendlyName()
          Returns a human-readable string version of the name of the subject of this certificate.
Category: Signed  String getType()
          Returns the type of this certificate, such as "X509", "WTLS" etc.
Category: Signed  int getVersion()
          Returns the version of the certificate.
Category: Signed  boolean isCA()
          Returns true if the certificate is of a certificate authority.
Category: Signed  boolean isRoot()
          Returns true if the certificate is self signed.
Category: Signed  boolean isValid()
          Checks that this certificate is valid, using the current date and time as the time reference.
Category: Signed  boolean isValid(long date)
          Check that this certificate is valid, using date as the time reference.
Category: Signed  int queryKeyUsage(long purpose)
          Indicates whether the key contained in this certificate may be used for the specified purpose.
Category: Signed  void setStatus(CertificateStatus status)
          Sets the current CertificateStatus for this certificate object.
Category: Signed  void verify()
          Verifies the certificate if the certificate is self signed.
Category: Signed  void verify(PublicKey issuerPublicKey)
          Verifies the certificate.
Category: Signed  void verify(KeyStore keyStore)
          Verifies the certificate.
 



Field Detail

EMAIL_ADDRESSES

static final long EMAIL_ADDRESSES
The identifier to indicate the extraction of email addresses from the certificate. This identifier can be passed into getInformation, which should return an array of email addresses. The result from getInformation should be cast to a String []. If no email addresses are found, getInformation should return null.

See Also:
Certificate.getInformation(long, java.lang.Object, java.lang.Object), Constant Field Values
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

PUBLIC_KEY_ALGORITHM_INFORMATION

static final long PUBLIC_KEY_ALGORITHM_INFORMATION
The identifier to indicate the extraction of the public key algorithm information from the certificate. This identifier can be passed into getInformation, which will return a byte array or null. If no information is present, the null is returned, otherwise the ASN.1 encoding of the parameters is returned as a byte array. The result from getInformation should be cast to a byte[].

See Also:
Certificate.getInformation(long, java.lang.Object, java.lang.Object), Constant Field Values
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.7.0

DISPLAY_ROOT

static final long DISPLAY_ROOT
The identifier to indicate the extraction of the information on whether to display the root certificate state or not. This identifier can be passed into getInformation, which will return a Boolean or null. If no information is present, the null is returned, otherwise a Boolean indicating whether this certificate wants to have the fact that it might be a root certificate displayed in the CertificateInfoDialog. If null is return then it is displayed by default. The result from getInformation should be cast to a Boolean.

See Also:
Certificate.getInformation(long, java.lang.Object, java.lang.Object), Constant Field Values
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 4.0.0

DISPLAY_CA

static final long DISPLAY_CA
The identifier to indicate the extraction of the information on whether to display the CA certificate state or not. This identifier can be passed into getInformation, which will return a Boolean or null. If no information is present, the null is returned, otherwise a Boolean indicating whether this certificate wants to have the fact that it might be a CA certificate displayed in the CertificateInfoDialog. If null is return then it is displayed by default. The result from getInformation should be cast to a Boolean.

See Also:
Certificate.getInformation(long, java.lang.Object, java.lang.Object), Constant Field Values
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 4.0.0

PROMPT_TO_TRUST_ON_IMPORT

static final long PROMPT_TO_TRUST_ON_IMPORT
The identifier to indicate whether or not this certificate should be added to the trusted key store on import based on some qualities that are specific to the certificate itself. If this is true, the importing code may attempt to add this to the trusted keystore and will prompt the user before doing so. If this certificate does not qualify for being added to the trusted keystore then it should simply return null when presented with this identifier.

Note that when this value is passed into the getInformation method a Boolean object must be passed in as the parameter object to indicate whether or not the private key will be imported with this certificate.

The result from getInformation should be cast to a Boolean.

See Also:
Certificate.getInformation(long, java.lang.Object, java.lang.Object), Constant Field Values
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 4.0.0

IS_END_ENTITY

static final long IS_END_ENTITY
The identifier to indicate whether or not this certificate is an end entity certificate. The result from getInformation should be cast to a Boolean.

See Also:
Certificate.getInformation(long, java.lang.Object, java.lang.Object), Constant Field Values
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 4.1.0

SUMMARY_TEXT

static final long SUMMARY_TEXT
The identifier to retrieve summary text which describes the certificate. For example this could be shown in an email body to describe the certificate which is attached. The result from getInformation should be cast to a String

See Also:
Certificate.getInformation(long, java.lang.Object, java.lang.Object), Constant Field Values
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 4.1.0


Method Detail

verify

void verify(PublicKey issuerPublicKey)
            throws CertificateVerificationException,
                   DecodeException,
                   InvalidSignatureEncodingException,
                   NoSuchAlgorithmException,
                   CryptoTokenException,
                   CryptoUnsupportedOperationException
Verifies the certificate.

The function checks that the certificate was signed by issuerPublicKey.

Parameters:
issuerPublicKey - The public key of the certificate issuer.
Throws:
CertificateVerificationException - Thrown if the certificate cannot be verified.
DecodeException - Thrown if the data is improperly formatted.
InvalidSignatureEncodingException - Thrown if the specified signature is invalid.
NoSuchAlgorithmException - Thrown if the specified algorithm is not known.
CryptoTokenException - Thrown if an error occurs with the crypto token or crypto token is invalid.
CryptoUnsupportedOperationException - Thrown if a call is made to an unsupported operation.
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

verify

void verify(KeyStore keyStore)
            throws CertificateVerificationException,
                   DecodeException,
                   InvalidSignatureEncodingException,
                   NoSuchAlgorithmException,
                   NoIssuerFoundException,
                   CryptoTokenException,
                   CryptoUnsupportedOperationException
Verifies the certificate.

The function checks that the certificate was signed by at least one of the publicKeys from the given keyStore.

Parameters:
keyStore - The keyStore that contains the keys.
Throws:
CertificateVerificationException - Thrown if the certificate cannot be verified.
DecodeException - Thrown if the data is improperly formatted.
InvalidSignatureEncodingException - Thrown if the specified signature is invalid.
NoSuchAlgorithmException - Thrown if the specified algorithm is not known.
NoIssuerFoundException - Thrown when the issuer of the certificate cannot be found.
CryptoTokenException - Thrown if an error occurs with the crypto token or crypto token is invalid.
CryptoUnsupportedOperationException - Thrown if a call is made to an unsupported operation.
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

isRoot

boolean isRoot()
Returns true if the certificate is self signed.

Returns:
A boolean. True if the certificate is self signed, false otherwise.
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

isCA

boolean isCA()
Returns true if the certificate is of a certificate authority.

Returns:
A boolean. True if the certificate is of a certificate authority. Returns false otherwise.
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

verify

void verify()
            throws CertificateVerificationException,
                   DecodeException,
                   InvalidSignatureEncodingException,
                   NoSuchAlgorithmException,
                   CryptoTokenException,
                   CryptoUnsupportedOperationException
Verifies the certificate if the certificate is self signed.

Throws:
CertificateVerificationException - Thrown if the certificate cannot be verified.
DecodeException - Thrown if the data is improperly formatted.
InvalidSignatureEncodingException - Thrown if the specified signature is invalid.
NoSuchAlgorithmException - Thrown if the specified algorithm is not known.
CryptoTokenException - Thrown if an error occurs with the crypto token or crypto token is invalid.
CryptoUnsupportedOperationException - Thrown if a call is made to an unsupported operation.
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

checkCertificateChain

void checkCertificateChain(int position,
                           Certificate[] chain)
                           throws CertificateChainTooLongException,
                                  CertificateVerificationException
Checks to make sure that the certificate at position is valid within the chain.

Parameters:
position - The position of this ceritificate within the chain.
chain - The array of certificates representing the certificate chain. The end-entity cert must be at array index [0].
Throws:
CertificateChainTooLongException - Thrown if the number of certificates, before this one, in the chain is longer than the certificates policy allows.
CertificateVerificationException - Thrown if there is another problem with the chain
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

getPublicKey

PublicKey getPublicKey()
                       throws InvalidCryptoSystemException
Extracts the subject's public key.

Returns:
The user's PublicKey.
Throws:
InvalidCryptoSystemException - Thrown if the crypto system used to create the key was invalid.
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

getPublicKeyAlgorithm

String getPublicKeyAlgorithm()
Returns a string representing the intended use of the public key. If no specific algorithm is intended for this public key, then the generic string for the public key will be returned.

Returns:
A string representing the intended use of the public key or null if an error occurred.
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

getSignatureAlgorithm

String getSignatureAlgorithm()
Returns a string representing the signature algorithm used to sign this certificate.

Returns:
A string representing the signature algorithm used to sign this certificate.
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

getIssuer

DistinguishedName getIssuer()
Returns a DistinguishedName object, representing the issuer of this certificate.

Returns:
The distinguished name of the certificate issuer.
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

getSubject

DistinguishedName getSubject()
Returns a DistinguishedName object, representing the subject name of this certificate.

Returns:
The distinguished name of the subject of the certifcate.
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

getStatus

CertificateStatus getStatus()
Retrieves the CertificateStatus for this certificate object

Returns:
the current CertificateStatus stored for this certificate on the device. 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

setStatus

void setStatus(CertificateStatus status)
               throws KeyStoreCancelException,
                      InvalidTimeException,
                      BackwardStatusException
Sets the current CertificateStatus for this certificate object.

Parameters:
status - the new CertificateStatus that will be set for this certificate. It is important to note that this status should not attempt to set the status backwards (i.e. from REVOKED to GOOD) and it should not allow the date of a status to be in the future.
Throws:
KeyStoreCancelException - if the user decides not to enter their KeyStore password.
InvalidTimeException - if the time of the status is set in the future.
BackwardStatusException - if the status of the certificate is being backwards (i.e. from REVOKED to GOOD ).
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

isValid

boolean isValid()
Checks that this certificate is valid, using the current date and time as the time reference.

It checks that the current date is between the values returned by getNotValidBefore() and getNotValidAfter().

Note that this method only checks that the current date is within the validity period specified in the certificate.

Returns:
A boolean that determines if the certificate is valid. Returns true if the certificate is valid, false otherwise.

See Also:
Certificate.verify()
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

isValid

boolean isValid(long date)
Check that this certificate is valid, using date as the time reference.

It checks that date is between the values returned by getNotBefore() and getNotValidAfter().

Note that this method only checks that date is within the validity period specified in the certificate.

Parameters:
date - The Date used to verify the certificate.
Returns:
A boolean that determines if the certificate is valid. Returns true if the certificate is valid, false otherwise.

See Also:
Certificate.verify()
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

getNotBefore

long getNotBefore()
Returns the date on which this certificate will become valid.

Returns:
A long that specifies when the certificate will become valid.
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

getNotAfter

long getNotAfter()
Returns the date on which this certificate will expire.

Returns:
A long that specifies when the certificate will expire.
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

getExtension

CertificateExtension getExtension(OID oid)
Returns the extension for the given oid if it exists in the certificate, otherwise null.

Parameters:
oid - The oid with the extension.
Returns:
The CertificateExtension or null.
See Also:
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

getExtensions

CertificateExtension[] getExtensions()
Returns all the extensions associated with this certificate, or null.

Returns:
An array of CertificateExtensions or null.
See Also:
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

getExtensions

CertificateExtension[] getExtensions(boolean criticalBit)
Returns all the extensions associated with this certificate that have their critical bit set to the value of criticalBit, or null if none are found.

Parameters:
criticalBit - a boolean that is true, if all critical extensions are to be returned and set to false if all non-critical extensions are to be returned
Returns:
An array of CertificateExtensions or null.
See Also:
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

getType

String getType()
Returns the type of this certificate, such as "X509", "WTLS" etc. Constants named TYPE_STRING_{X509|WTLS|etc} available in this interface

Returns:
A String representing the certificate type.
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

getVersion

int getVersion()
Returns the version of the certificate.

The version is specific to the type of certificate.

Returns:
An integer representing the version number.
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

byte[] getSerialNumber()
Returns the certificates serial number as a byte array representing an an integer in big-endian (network) order.

Returns:
A byte array containing the serial number.
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

byte[] getEncoding()
Returns the encoding of the certificate.

Returns:
A byte array containing the encoding. 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

getEncoding

byte[] getEncoding(int field)
Returns the encoding of the field within the certificate (see CertificateField).

Parameters:
field - An integer that represents the field.
Returns:
A byte array that represents the encoding of the field. 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

getSubjectFriendlyName

String getSubjectFriendlyName()
Returns a human-readable string version of the name of the subject of this certificate.

This string could be used for display purposes, for example. For the default behaviour, which attempts to build a friendly name using parts of the subject distinguished name, invoke CertificateUtilities.getSubjectFriendlyName(Certificate certificate).

Returns:
A String representing the subject 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

queryKeyUsage

int queryKeyUsage(long purpose)
Indicates whether the key contained in this certificate may be used for the specified purpose.

Parameters:
purpose - A constant chosen from the KeyUsage constants indicating the purpose for which the key will be checked.
Returns:
KeyUsageResult.ALLOWED Thrown if the subject public key may be used for the specified purpose.
KeyUsageResult.NOT_ALLOWED Thrown if the subject public key may not be used for the specified purpose.
KeyUsageResult.UNSPECIFIED Thrown if it is unspecified whether the subject public key may be used for this purpose.
See Also:
KeyUsageResult
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

getCustomDisplayFields

CertificateDisplayField[] getCustomDisplayFields()
Returns custom information about the certificate for display in a dialog.

The displayCertificateDetails method in CertificateUtilities uses this custom information to format a dialog box containing details about the certificate. Details common to all types of certificates, like the subject name, issuer name, etc., are always displayed in the dialog; this function allows specific certificate types to add specific information to the dialog.

Returns:
An array of CertificateDisplayField objects containing label/value pairs for the information that is to be shown in the dialog, or null if no custom information should be displayed
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

getInformation

Object getInformation(long id,
                      Object param,
                      Object defaultValue)
Retrieves generic information about the certificate

Parameters:
id - the id of the data to retrieve
param - a parameter that may be used to determine what information to return
defaultValue - a default value that should be returned if the certificate does not recognize the id.
Returns:
information about the certificate matching the id and param
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.