net.rim.device.api.crypto.keystore
Interface KeyStore

All Superinterfaces:
CollectionEventSource
All Known Implementing Classes:
CombinedKeyStore, DeviceKeyStore, PersistableRIMKeyStore, RIMKeyStore, SyncableRIMKeyStore, TrustedKeyStore

public interface KeyStore
extends CollectionEventSource

A Keystore securely stores and protects access to a set of cryptographic keys and certificates.

See Also:
RIMKeyStore, PersistableRIMKeyStore, SyncableRIMKeyStore
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 int SECURITY_LEVEL_HIGH
          High security level.
Category: Signed static int SECURITY_LEVEL_LOW
          Low security level.
Category: Signed static int SECURITY_LEVEL_MEDIUM
          Medium Security level.
Category: Signed static int SECURITY_LEVEL_NOT_APPLICABLE
          This indicates that the security level for this record is not applicable because no private or symmetric key is being protected with the password.
 
Method Summary
Category: Signed  void addCollectionListener(Object listener)
          This method is called when the developer wants to listen in on when records are added and removed to/from a particular keystore.
Category: Signed  boolean addIndex(KeyStoreIndex index)
          Adds an index to all of the information currently in the key store.
Category: Signed  void addIndices(KeyStoreIndex[] indices)
          Adds an array of indices to the key store.
Category: Signed  void changePassword()
          Changes the password for the underlying private keys in each of the KeystoreData classes and should NOT be called directly.
Category: Signed  boolean checkTicket(KeyStoreTicket ticket)
          Returns a boolean denoting whether or not this ticket will work with this KeyStore.
Category: Signed  Enumeration elements()
          Returns an enumeration of all the KeyStoreData[] that are stored in the KeyStore.
Category: Signed  Enumeration elements(boolean backingKeyStore)
          Returns an enumeration of all the KeyStoreData that are stored in the KeyStore AND the backing keystore if the boolean is set to true.
Category: Signed  Enumeration elements(long index)
          Returns an enumeration of all the elements KeyStoreData inside the key store according to the index provided with the parameter.
Category: Signed  Enumeration elements(long index, boolean backingKeyStore)
          Returns an enumeration of all the elements KeyStoreData inside the key store according to the index provided with the parameter.
Category: Signed  Enumeration elements(long index, Object alias)
          Returns an array of keystore information that contains the certificates, keys and other data associated with this alias.
Category: Signed  Enumeration elements(long index, Object alias, boolean backingKeyStore)
          Returns an array of keystore information that contains the certificates, keys and other data associated with this alias.
Category: Signed  boolean exists(long index, Object alias)
          Returns a boolean denoting whether an object exists with the given alias and the given index class.
Category: Signed  boolean existsIndex(long index)
          Returns a boolean denoting whether this index already exists in the key store.
Category: Signed  KeyStore getBackingKeyStore()
          This method returns the backing keystore if it exists.
Category: Signed  String getName()
          Returns the name of the key store.
Category: Signed  KeyStoreTicket getTicket()
          Returns a ticket that allows the caller to use the keystore without prompting the user for their password.
Category: Signed  KeyStoreTicket getTicket(String prompt)
          Returns a ticket that allows the caller to use the keystore without prompting the user for their password.
Category: Signed  boolean isMember(byte[] certificateEncoding)
          Returns a boolean dictating whether or not this certificate is contained inside the KeyStore.
Category: Signed  boolean isMember(Key key)
          Returns a boolean dictating whether or not this key is contained inside the KeyStore.
Category: Signed  boolean isMember(Certificate certificate)
          Returns a boolean dictating whether or not this certificate is contained inside the KeyStore.
Category: Signed  boolean isMember(KeyStoreData data)
          Returns a boolean dictating whether or not this KeyStoreData is contained inside the KeyStore.
Category: Signed  void removeCollectionListener(Object listener)
          This method is called when the developer wants to remove the listener from this keystore.
Category: Signed  void removeIndex(long index)
          Removes the index from the key store and ensures that the aliases used to index key store information regarding this Index class will be removed.
Category: Signed  void removeKey(KeyStoreData data, KeyStoreTicket ticket)
          Removes this key store data from the key store and ensures that any links to this object are removed from the key store.
Category: Signed  KeyStoreData set(AssociatedData[] associatedData, String label, PrivateKey privateKey, String privateKeyEncodingAlgorithm, int securityLevel, PublicKey publicKey, long keyUsage, KeyStoreTicket ticket)
          Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.
Category: Signed  KeyStoreData set(AssociatedData[] associatedData, String label, PrivateKey privateKey, String privateKeyEncodingAlgorithm, int securityLevel, Certificate certificate, CertificateStatus certStatus, KeyStoreTicket ticket)
          Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.
Category: Signed  KeyStoreData set(AssociatedData[] associatedData, String label, PrivateKey privateKey, String privateKeyEncodingAlgorithm, int securityLevel, KeyStoreTicket ticket)
          Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.
Category: Signed  KeyStoreData set(AssociatedData[] associatedData, String label, PublicKey publicKey, long keyUsage, KeyStoreTicket ticket)
          Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.
Category: Signed  KeyStoreData set(AssociatedData[] associatedData, String label, SymmetricKey symmetricKey, String symmetricKeyEncodingAlgorithm, int securityLevel, KeyStoreTicket ticket)
          Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.
Category: Signed  KeyStoreData set(AssociatedData[] associatedData, String label, Certificate certificate, CertificateStatus certStatus, KeyStoreTicket ticket)
          Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.
Category: Signed  int size()
          Returns the number of elements inside the key store.
 



Field Detail

SECURITY_LEVEL_HIGH

static final int SECURITY_LEVEL_HIGH
High security level. High security means that you will be prompted for a password or ok/cancel each time you access the keystore.

See Also:
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

SECURITY_LEVEL_LOW

static final int SECURITY_LEVEL_LOW
Low security level. Low security means that you will never be prompted for a password or ok/cancel when someone attempts to access your keystore.

See Also:
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

SECURITY_LEVEL_MEDIUM

static final int SECURITY_LEVEL_MEDIUM
Medium Security level. Medium security means that you will be prompt for a password to access the keystore unless the password has been cached. In the case where the password is cached, there will be no ok/cancel prompt like in the case of high security.

See Also:
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

SECURITY_LEVEL_NOT_APPLICABLE

static final int SECURITY_LEVEL_NOT_APPLICABLE
This indicates that the security level for this record is not applicable because no private or symmetric key is being protected with the password.

See Also:
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


Method Detail

set

KeyStoreData set(AssociatedData[] associatedData,
                 String label,
                 PrivateKey privateKey,
                 String privateKeyEncodingAlgorithm,
                 int securityLevel,
                 KeyStoreTicket ticket)
                 throws NoSuchAlgorithmException,
                        InvalidKeyEncodingException,
                        CryptoTokenException,
                        CryptoUnsupportedOperationException,
                        KeyStoreCancelException,
                        InvalidKeyException
Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.

Note: ANY OF THESE PARAMETERS CAN BE NULL without causing any problems for the key store.

Parameters:
associatedData - An associated Data array containing all of the aliases to index this record on in the keystore. This can be null and we will simply rely on other indices added to the KeyStore to find your key.
label - The label that is shown to the user when the private key is accessed. This gives the user some information about what private key is being accessed so they can make a informed decision about inputting their private key password to unlock the key. It should be noted that this label will have a string prefixed to it such as "Please enter your passphrase for: " and then your string.
privateKey - The private key data to be stored in the keystore.
privateKeyEncodingAlgorithm - Allows the user to specify what encoding algorithm is used to encode the private key.
securityLevel - The security level associated with this key store data private key. That is, when someone attempts to access the private key they will be prompted according to the security level of the key store data.

HighThe user will be asked for a passphrase
LowThe user will not be prompted.

Note: Once the security level is set it cannot be changed.

ticket - A ticket denoting whether or not the developer has access to the keystore. A ticket can be retrieved from the getTicket method in the key store or keystore data. The ticket can also be null which will most likely prompt for a passphrase from the user automatically (essentially calls getTicket for you).
Returns:
the KeyStoreData object that was added to the keystore.
Throws:
NoSuchAlgorithmException - Thrown when the specified cipher is invalid.
InvalidKeyEncodingException - Thrown when the specified key is improperly formatted. Note: This method does not affect any underlying keystores.
CryptoTokenException - Thrown when an error occurs with the crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
KeyStoreCancelException - Thrown when the user fails to enter a password or decides to cancel the password entry operation.
InvalidKeyException - Thrown when the specified key is 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

set

KeyStoreData set(AssociatedData[] associatedData,
                 String label,
                 PrivateKey privateKey,
                 String privateKeyEncodingAlgorithm,
                 int securityLevel,
                 PublicKey publicKey,
                 long keyUsage,
                 KeyStoreTicket ticket)
                 throws NoSuchAlgorithmException,
                        InvalidKeyEncodingException,
                        CryptoTokenException,
                        CryptoUnsupportedOperationException,
                        KeyStoreCancelException,
                        InvalidKeyException
Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.

Note: ANY OF THESE PARAMETERS CAN BE NULL without causing any problems for the key store.

Parameters:
associatedData - An associated Data array containing all of the aliases to index this record on in the keystore. This can be null and we will simply rely on other indices added to the KeyStore to find your key.
label - The label that is shown to the user when the private key is accessed. This gives the user some information about what private key is being accessed so they can make a informed decision about inputting their private key password to unlock the key. It should be noted that this label will have a string prefixed to it such as "Please enter your passphrase for: " and then your string.
privateKey - The private key data to be stored in the keystore.
privateKeyEncodingAlgorithm - Allows the user to specify what encoding algorithm is used to encode the private key.
securityLevel - The security level associated with this key store data private key. That is, when someone attempts to access the private key they will be prompted according to the security level of the key store data.

HighThe user will be asked for a passphrase
LowThe user will not be prompted.

Note: Once the security level is set it cannot be changed.

publicKey - The public key data associated with the private key that will be stored in the key store. Note that we make no restrictions on what is stored in these records. The public key does not have to match the private key (make a key pair) if not desired. Note: This method does not affect any underlying keystores.
keyUsage - Specifies the key usage of the key - see KeyUsage. These fields can be OR'd together to produce the correct key usage stored as an integer.
ticket - A ticket denoting whether or not the developer has access to the keystore. A ticket can be retrieved from the getTicket method in the key store or keystore data. The ticket can also be null which will most likely prompt for a passphrase from the user automatically (essentially calls getTicket for you).
Returns:
the KeyStoreData object that was added to the keystore.
Throws:
NoSuchAlgorithmException - Thrown when the specified cipher is invalid.
InvalidKeyEncodingException - Thrown when the specified key is improperly formatted.
CryptoTokenException - Thrown when an error occurs with the crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
KeyStoreCancelException - Thrown when the user fails to enter a password or decides to cancel the password entry operation.
InvalidKeyException - Thrown when the specified key is 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

set

KeyStoreData set(AssociatedData[] associatedData,
                 String label,
                 PrivateKey privateKey,
                 String privateKeyEncodingAlgorithm,
                 int securityLevel,
                 Certificate certificate,
                 CertificateStatus certStatus,
                 KeyStoreTicket ticket)
                 throws NoSuchAlgorithmException,
                        InvalidKeyEncodingException,
                        CryptoTokenException,
                        CryptoUnsupportedOperationException,
                        KeyStoreCancelException,
                        InvalidKeyException
Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.

Note: ANY OF THESE PARAMETERS CAN BE NULL without causing any problems for the key store.

Parameters:
associatedData - An associated Data array containing all of the aliases to index this record on in the keystore. This can be null and we will simply rely on other indices added to the KeyStore to find your key.
label - The label that is shown to the user when the private key is accessed. This gives the user some information about what private key is being accessed so they can make a informed decision about inputting their private key password to unlock the key. It should be noted that this label will have a string prefixed to it such as "Please enter your passphrase for: " and then your string.
privateKey - The private key data to be stored in the keystore.
privateKeyEncodingAlgorithm - Allows the user to specify what encoding algorithm is used to encode the private key.
securityLevel - The security level associated with this key store data private key. That is, when someone attempts to access the private key they will be prompted according to the security level of the key store data.

HighThe user will be asked for a passphrase
LowThe user will not be prompted.

Note: Once the security level is set it cannot be changed. Note: This method does not affect any underlying keystores.

certificate - A certificate corresponding to this key store data.
certStatus - The certificate status that is accompanying the certificate for this key store data.
ticket - A ticket denoting whether or not the developer has access to the keystore. A ticket can be retrieved from the getTicket method in the key store or keystore data. The ticket can also be null which will most likely prompt for a passphrase from the user automatically (essentially calls getTicket for you).
Returns:
the KeyStoreData object that was added to the keystore.
Throws:
NoSuchAlgorithmException - Thrown when the specified cipher is invalid.
InvalidKeyEncodingException - Thrown when the specified key is improperly formatted.
CryptoTokenException - Thrown when an error occurs with the crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
KeyStoreCancelException - Thrown when the user fails to enter a password or decides to cancel the password entry operation.
InvalidKeyException - Thrown when the specified key is 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

set

KeyStoreData set(AssociatedData[] associatedData,
                 String label,
                 PublicKey publicKey,
                 long keyUsage,
                 KeyStoreTicket ticket)
                 throws NoSuchAlgorithmException,
                        InvalidKeyEncodingException,
                        CryptoTokenException,
                        CryptoUnsupportedOperationException,
                        KeyStoreCancelException,
                        InvalidKeyException
Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.

Note: ANY OF THESE PARAMETERS CAN BE NULL without causing any problems for the key store.

Parameters:
associatedData - An associated Data array containing all of the aliases to index this record on in the keystore. This can be null and we will simply rely on other indices added to the KeyStore to find your key. Note: This method does not affect any underlying keystores.
label - The label that is shown to the user when the private key is accessed. This gives the user some information about what private key is being accessed so they can make a informed decision about inputting their private key password to unlock the key. It should be noted that this label will have a string prefixed to it such as "Please enter your passphrase for: " and then your string.
publicKey - The public key data associated with the private key that will be stored in the key store. Note that we make no restrictions on what is stored in these records. The public key does not have to match the private key (make a key pair) if not desired.
keyUsage - Specifies the key usage of the key - see KeyUsage. These fields can be OR'd together to produce the correct key usage stored as an integer.
ticket - A ticket denoting whether or not the developer has access to the keystore. A ticket can be retrieved from the getTicket method in the key store or keystore data. The ticket can also be null which will most likely prompt for a passphrase from the user automatically (essentially calls getTicket for you).
Returns:
the KeyStoreData object that was added to the keystore.
Throws:
NoSuchAlgorithmException - Thrown when the specified cipher is invalid.
InvalidKeyEncodingException - Thrown when the specified key is improperly formatted.
CryptoTokenException - Thrown when an error occurs with the crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
KeyStoreCancelException - Thrown when the user fails to enter a password or decides to cancel the password entry operation.
InvalidKeyException - Thrown when the specified key is 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

set

KeyStoreData set(AssociatedData[] associatedData,
                 String label,
                 Certificate certificate,
                 CertificateStatus certStatus,
                 KeyStoreTicket ticket)
                 throws NoSuchAlgorithmException,
                        InvalidKeyEncodingException,
                        CryptoTokenException,
                        CryptoUnsupportedOperationException,
                        KeyStoreCancelException,
                        InvalidKeyException
Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.

Note: ANY OF THESE PARAMETERS CAN BE NULL without causing any problems for the key store.

Parameters:
associatedData - An associated Data array containing all of the aliases to index this record on in the keystore. This can be null and we will simply rely on other indices added to the KeyStore to find your key. Note: This method does not affect any underlying keystores.
label - The label that is shown to the user when the private key is accessed. This gives the user some information about what private key is being accessed so they can make a informed decision about inputting their private key password to unlock the key. It should be noted that this label will have a string prefixed to it such as "Please enter your passphrase for: " and then your string.
certificate - A certificate corresponding to this key store data.
certStatus - The certificate status that is accompanying the certificate for this key store data.
ticket - A ticket denoting whether or not the developer has access to the keystore. A ticket can be retrieved from the getTicket method in the key store or keystore data. The ticket can also be null which will most likely prompt for a passphrase from the user automatically (essentially calls getTicket for you).
Returns:
the KeyStoreData object that was added to the keystore.
Throws:
NoSuchAlgorithmException - Thrown when the specified cipher is invalid.
InvalidKeyEncodingException - Thrown when the specified key is improperly formatted.
CryptoTokenException - Thrown when an error occurs with the crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
KeyStoreCancelException - Thrown when the user fails to enter a password or decides to cancel the password entry operation.
InvalidKeyException - Thrown when the specified key is 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

set

KeyStoreData set(AssociatedData[] associatedData,
                 String label,
                 SymmetricKey symmetricKey,
                 String symmetricKeyEncodingAlgorithm,
                 int securityLevel,
                 KeyStoreTicket ticket)
                 throws NoSuchAlgorithmException,
                        InvalidKeyEncodingException,
                        CryptoTokenException,
                        CryptoUnsupportedOperationException,
                        KeyStoreCancelException,
                        InvalidKeyException
Adds a KeyStoreData class containing the information that will be associated with the array of aliases contained inside this class.

Note: ANY OF THESE PARAMETERS CAN BE NULL without causing any problems for the key store.

Parameters:
associatedData - An associated Data array containing all of the aliases to index this record on in the keystore. This can be null and we will simply rely on other indices added to the KeyStore to find your key.
label - The label that is shown to the user when the private key is accessed. This gives the user some information about what private key is being accessed so they can make a informed decision about inputting their private key password to unlock the key. It should be noted that this label will have a string prefixed to it such as "Please enter your passphrase for: " and then your string.
symmetricKey - A symmetric key to be stored in the key store.
symmetricKeyEncodingAlgorithm - The encoding algorithm associated with the key.
securityLevel - The security level associated with this key store data private key. That is, when someone attempts to access the private key they will be prompted according to the security level of the key store data.

HighThe user will be asked for a passphrase
LowThe user will not be prompted.

Note: Once the security level is set it cannot be changed. Note: This method does not affect any underlying keystores.

ticket - A ticket denoting whether or not the developer has access to the keystore. A ticket can be retrieved from the getTicket method in the key store or keystore data. The ticket can also be null which will most likely prompt for a passphrase from the user automatically (essentially calls getTicket for you).
Returns:
the KeyStoreData object that was added to the keystore.
Throws:
NoSuchAlgorithmException - Thrown when the specified cipher is invalid.
InvalidKeyEncodingException - Thrown when the specified key is improperly formatted.
CryptoTokenException - Thrown when an error occurs with the crypto token or the crypto token is invalid.
CryptoUnsupportedOperationException - Thrown when a call is made to an unsupported operation.
KeyStoreCancelException - Thrown when the user fails to enter a password or decides to cancel the password entry operation.
InvalidKeyException - Thrown when the specified key is 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

elements

Enumeration elements(long index,
                     Object alias)
Returns an array of keystore information that contains the certificates, keys and other data associated with this alias. Note that this method will not return any records from the underlying keystore UNLESS there are no records found in the existing keystore. If you want it to always search the underlying keystore as well then use the other method with the boolean.

Parameters:
index - A string representing the Index class that denotes where to find the alias and how it is used.
alias - An object denoting which key store information should be returned.
Returns:
An Enumeration of KeyStoreData objects.
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

elements

Enumeration elements(long index,
                     Object alias,
                     boolean backingKeyStore)
Returns an array of keystore information that contains the certificates, keys and other data associated with this alias. This method will search the backing keystore if the boolean is set to true. If set to false it will have the same behavior as the other similar elements method.

Parameters:
index - A string representing the Index class that denotes where to find the alias and how it is used.
alias - An object denoting which key store information should be returned.
backingKeyStore - a boolean denoting whether or not to automatically search through the underlying key store.
Returns:
An Enumeration of KeyStoreData objects.
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

removeKey

void removeKey(KeyStoreData data,
               KeyStoreTicket ticket)
               throws KeyStoreCancelException
Removes this key store data from the key store and ensures that any links to this object are removed from the key store. Note: This does not affect the underlying keystore.

Parameters:
data - The data to be removed from the key store.
ticket - A ticket denoting whether or not the developer has access to the keystore. A ticket can be retrieved from the getTicket method in the key store or keystore data. The ticket can also be null which will most likely prompt for a passphrase from the user automatically (essentially calls getTicket for you).
Throws:
KeyStoreCancelException - Thrown if the user fails to enter a password.
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

elements

Enumeration elements()
Returns an enumeration of all the KeyStoreData[] that are stored in the KeyStore. Note that this function will not return any elements from the backing keystore.

Returns:
An Enumeration of KeyStoreData objects.
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

elements

Enumeration elements(boolean backingKeyStore)
Returns an enumeration of all the KeyStoreData that are stored in the KeyStore AND the backing keystore if the boolean is set to true. If the boolean is set to false then it simply returns all the elements in the current keystore.

Returns:
An Enumeration of KeyStoreData objects.
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

elements

Enumeration elements(long index)
Returns an enumeration of all the elements KeyStoreData inside the key store according to the index provided with the parameter. Note that this method will NOT return any elements from the backing keystore.

Parameters:
index - A long representing what index to return an enumeration of the elements for.
Returns:
An enumeration of all the KeyStoreData items.
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

elements

Enumeration elements(long index,
                     boolean backingKeyStore)
Returns an enumeration of all the elements KeyStoreData inside the key store according to the index provided with the parameter.

Parameters:
index - A long representing what index to return an enumeration of the elements for.
backingKeyStore - a boolean which determines whether elements should also be returned from the backing keystore.
Returns:
An enumeration of all the KeyStoreData items.
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

exists

boolean exists(long index,
               Object alias)
Returns a boolean denoting whether an object exists with the given alias and the given index class. Note that this function does not look in the underlying keystore.

Parameters:
index - The long denoting the index class.
alias - An object representing the alias to the key store information.
Returns:
Returns true if the object exists, 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

addIndex

boolean addIndex(KeyStoreIndex index)
Adds an index to all of the information currently in the key store. This now enables the developer to access information in the key store according to this new alias field. Note: This does not add the index to the underlying keystore.

Parameters:
index - An Index class that is implemented by the developer. It denotes how the key store information is indexed according to fields currently contained in key store objects such as certificates.
Returns:
A boolean denoting if the index was added correctly. It will return false if the index already exists.
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

addIndices

void addIndices(KeyStoreIndex[] indices)
Adds an array of indices to the key store. This method allows us to take advantage of possible overlaps in indexing all of the information currently in the key store. This now enables the developer to access information in the key store according to this new alias field. Note: This does not add the indices to the underlying keystore.

Parameters:
indices - An array of Index classes that is implemented by the developer. It denotes how the key store information is indexed according to fields currently contained in key store objects such as certificates.
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

removeIndex

void removeIndex(long index)
Removes the index from the key store and ensures that the aliases used to index key store information regarding this Index class will be removed. Note: This does not remove the index from the underlying keystore.

Parameters:
index - The long denoting the index class to remove.
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

existsIndex

boolean existsIndex(long index)
Returns a boolean denoting whether this index already exists in the key store. Note: This does not check the underlying keystore.

Parameters:
index - The long representing the index.
Returns:
A boolean that returns true if the index exists.
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

size

int size()
Returns the number of elements inside the key store.

Returns:
An integer that specifies the size.
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

changePassword

void changePassword()
Changes the password for the underlying private keys in each of the KeystoreData classes and should NOT be called directly. It should only be called by the KeyStoreManager. If this method is called it will cause the keystore to enter into a weird state and will disable its use. If you are designing your own keystore this method should be implemented to call changePassword on each of the KeyStoreData items in the keystore.

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

getTicket

KeyStoreTicket getTicket()
                         throws KeyStoreCancelException
Returns a ticket that allows the caller to use the keystore without prompting the user for their password.

This method may prompt for a passphrase from the user.

Returns:
The key store ticket.
Throws:
KeyStoreCancelException - Thrown when the user fails to enter a password or decides to cancel the password entry 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

getTicket

KeyStoreTicket getTicket(String prompt)
                         throws KeyStoreCancelException
Returns a ticket that allows the caller to use the keystore without prompting the user for their password.

This method may prompt for a passphrase from the user.

Parameters:
prompt - an additional string provided to the allow the application developer to customize the ticket prompt dialog to better fit their application needs.
Returns:
The key store ticket.
Throws:
KeyStoreCancelException - Thrown when the user fails to enter a password or decides to cancel the password entry 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

checkTicket

boolean checkTicket(KeyStoreTicket ticket)
Returns a boolean denoting whether or not this ticket will work with this KeyStore.

Parameters:
ticket - the KeyStoreTicket we want to check.
Returns:
true if the ticket is valid for this record and 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

getName

String getName()
Returns the name of the key store.

Returns:
The name of the key store.
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

isMember

boolean isMember(Certificate certificate)
Returns a boolean dictating whether or not this certificate is contained inside the KeyStore. Note: This does not check the underlying keystore.

Parameters:
certificate - The specified certificate.
Returns:
A boolean that specifies if the certificate was found within the key store. Returns true if the certificate was found.
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

isMember

boolean isMember(byte[] certificateEncoding)
Returns a boolean dictating whether or not this certificate is contained inside the KeyStore. Note: This does not check the underlying keystore.

Parameters:
certificateEncoding - The encoding of the specified certificate.
Returns:
A boolean that specifies if the certificate was found within the key store. Returns true if the certificate was found.
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

isMember

boolean isMember(Key key)
Returns a boolean dictating whether or not this key is contained inside the KeyStore.

Note that a key can represent a PublicKey, PrivateKey, or SymmetricKey at this time.

Note: This does not check the underlying keystore.

Parameters:
key - The specified key.
Returns:
A boolean that specifies if the key was found within the key store. Returns true if the key was found.
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

isMember

boolean isMember(KeyStoreData data)
Returns a boolean dictating whether or not this KeyStoreData is contained inside the KeyStore. Note: This does not check the underlying keystore.

Parameters:
data - The key store data.
Returns:
A boolean that determines if the specified key store data is found within the key store. Returns true if the data was found.
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

addCollectionListener

void addCollectionListener(Object listener)
This method is called when the developer wants to listen in on when records are added and removed to/from a particular keystore. Note: This does not add the listener to the underlying keystore.

Specified by:
addCollectionListener in interface CollectionEventSource
Parameters:
listener - The KeyStoreListener interface that must be implemented by the calling class which will be called when a record is added or removed.
See Also:
CollectionEventSource.addCollectionListener(java.lang.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

removeCollectionListener

void removeCollectionListener(Object listener)
This method is called when the developer wants to remove the listener from this keystore. Note: This does not remove the listener from the underlying keystore.

Specified by:
removeCollectionListener in interface CollectionEventSource
Parameters:
listener - The KeyStoreListener to be removed.
See Also:
CollectionEventSource.removeCollectionListener(java.lang.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

getBackingKeyStore

KeyStore getBackingKeyStore()
This method returns the backing keystore if it exists. The backing keystore is a keystore that the creator of the existing keystore passed into the constructor. It allows for chaining of existing keystores using the get and elements method. The biggest advantage of the backing keystore is during searching for a KeyStoreData record. In the case where it is not found in the current keystore the code will look in the backing keystore if one exists.

Returns:
the backing KeyStore if it exists and null 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





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