Defines the properties of all certificates. A certificate
is a collection of data used to associate a public key with an identity.
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.
DISPLAY_CA
The identifier to indicate the extraction of the information on whether to display the CA certificate state or not.
static long
DISPLAY_ROOT
The identifier to indicate the extraction of the information on whether to display the root certificate state or not.
static long
EMAIL_ADDRESSES
The identifier to indicate the extraction of email addresses from the certificate.
static long
IS_END_ENTITY
The identifier to indicate whether or not this certificate is an end entity certificate.
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.
static long
PUBLIC_KEY_ALGORITHM_INFORMATION
The identifier to indicate the extraction of the public key algorithm information from the certificate.
static long
SUMMARY_TEXT
The identifier to retrieve summary text which describes the certificate.
Method Summary
void
checkCertificateChain(int position,
Certificate[] chain)
Checks to make sure that the certificate at position is valid within the chain.
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.
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.
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.
DISPLAY_ROOT
public 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.
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.
EMAIL_ADDRESSES
public 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.
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.
IS_END_ENTITY
public 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.
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.
PROMPT_TO_TRUST_ON_IMPORT
public 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.
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.
PUBLIC_KEY_ALGORITHM_INFORMATION
public 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[].
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.
SUMMARY_TEXT
public 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
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.
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.
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
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 the encoding of the certificate.
Returns:
A byte array containing the encoding. 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(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.
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.
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.
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.
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.
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
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.
Returns a DistinguishedName object,
representing the issuer of this certificate.
Returns:
The distinguished name of the certificate issuer.
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.
getNotAfter
public long getNotAfter()
Returns the date on which this certificate will expire.
Returns:
A long that specifies when the certificate
will expire.
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.
getNotBefore
public long getNotBefore()
Returns the date on which this certificate will become valid.
Returns:
A long that specifies when the certificate will become valid.
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.
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.
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.
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 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.
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.
Returns a string representing the signature algorithm used to sign this certificate.
Returns:
A string representing the signature algorithm used to sign this certificate.
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.
Retrieves the CertificateStatus for this certificate object
Returns:
the current CertificateStatus stored for this
certificate on the device. 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.
Returns a DistinguishedName object,
representing the subject name of this certificate.
Returns:
The distinguished name of the subject of the certifcate.
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.
A String representing the subject 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.
Returns the type of this certificate, such as "X509", "WTLS" etc.
Returns:
A String representing the certificate type.
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.
getVersion
public int getVersion()
Returns the version of the certificate.
The version is specific to the type of certificate.
Returns:
An integer representing the version number.
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.
isCA
public 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.
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.
isRoot
public boolean isRoot()
Returns true if the certificate is self signed.
Returns:
A boolean. True if the certificate is self signed, false otherwise.
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.
isValid
public 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.
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.
isValid
public 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.
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.
queryKeyUsage
public 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.
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.
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.
BackwardStatusException - if the status of the certificate is being
backwards (i.e. from REVOKED to GOOD ).
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.
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.
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.
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.