This class contains the basic key store implementation.
It will store keys but only temporarily (until the device is
reset) so it should NOT be used to store permanent keys.
For sample code on how to use a key store see:
here
NOTE: In previous versions of this api, there was a protected variable ( called _vector )
that a subclass could use to access all of the members of the keystore. This variable has been
made private since there wasn't enough functionality exposed to really make use of it. If
you need to access all of the KeyStoreData members for this class, use the elements() function.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
set(AssociatedData[] associatedData,
KeyStoreData data)
Adds a KeyStoreData class containing the information
that will be associated with the array of aliases contained
inside this class.
This constructor allows the developer to create a key store with no
underlying keystore.
Note that a RIMKeyStore does not allow for the record to be persisted. That means
that anything you place in this keystore will be lost when the device
is reset. It will mostly be used for temporary key stores and nothing more.
For a persistent key store, please see the subclass.
Parameters:
name - An identifying name for the keystore that can be displayed to the user.
Throws:
KeyStoreRegisterException - thrown when there is an error registering this
class with the KeyStoreManager which is typically caused by one of three exceptions
being thrown in that method (ClassNotFoundException, InstantiationException, IllegalAccessException).
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
This constructor allows one to create a key store with an underlying key
store.
Note that a RIMKeyStore does not allow for the record to be persisted. That means
that anything you place in this keystore will be lost when the device
is reset. It will mostly be used for temporary key stores and nothing more.
For a persistent key store, please see the subclass.
Parameters:
name - An identifying name for the keystore that can be displayed to the user.
keyStore - An underlying keystore that can be used to search through when
keys are not found in this current keystore.
Throws:
KeyStoreRegisterException - thrown when there is an error registering this
class with the KeyStoreManager which is typically caused by one of three exceptions
being thrown in that method (ClassNotFoundException, InstantiationException, IllegalAccessException).
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
A protected constructor used for the subclasses who extend this
class directly.
It allows for a string for registration info
to be sent down and to ensure that only one registration request
needs to occur.
Parameters:
name - An identifying name for the keystore that can be displayed to the user.
className - A string containing the class name of the factory
that we are going to instantiate after a reset.
id - A long representing which key store this is. It has to be unique.
key - a CodeSigningKey which can be used to prevent unauthorized access to your keystore.
keyStore - An additional underlying keystore where requests are
sent when the data is not found in this keystore.
Throws:
KeyStoreRegisterException - thrown when there is an error registering this
class with the KeyStoreManager which is typically caused by one of three exceptions
being thrown in that method (ClassNotFoundException, InstantiationException, IllegalAccessException).
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Adds a KeyStoreData class containing the information
that will be associated with the array of aliases contained
inside this class.
Parameters:
associatedData - An associated data array containing all of the aliases
to index this record on in the keystore.
data - The information that is to be stored in the
keystore.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
elements
public Enumerationelements(long index,
Object target,
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
A protected function to allow a subclass to remove a key without a ticket prompt.
Parameters:
data - The KeystoreData to remove.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
elements
public Enumerationelements(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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
elements
public Enumerationelements(long index,
boolean backingKeyStore)
Returns an enumeration of all the elements KeyStoreData
inside the key store according to the index provided
with the parameter.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Returns a boolean denoting whether this index already exists in
the key store.
Note: This does not check the underlying keystore.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Returns the number of elements inside the key store.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Returns a boolean dictating whether or not this certificate is contained inside
the KeyStore.
Note: This does not check the underlying keystore.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
isMember
public 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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Returns a boolean dictating whether or not this KeyStoreData is contained inside
the KeyStore.
Note: This does not check the underlying keystore.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
A boolean that represents validity of the ticket. Returns true
if the ticket is valid, false otherwise.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
addCollectionListener
public void addCollectionListener(Object listener)
Registers a listener to receive collection events.
Note: object parameters that are passed back to the listener when an event occurs
should be down cast to a KeyStoreData object.
Parameters:
listener - Object to register as a listener which must implement
CollectionListener or one of its derived interfaces.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
removeCollectionListener
public void removeCollectionListener(Object listener)
Removes a listener object from the list of those receiving events.
Note: object parameters that are passed back to the listener when an event occurs
should be down cast to a KeyStoreData object.
Parameters:
listener - Listener to remove.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
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.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Copyright 1999-2006 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.