net.rim.device.api.crypto.keystore
Class SyncableRIMKeyStore

java.lang.Object
  extended by net.rim.device.api.crypto.keystore.RIMKeyStore
      extended by net.rim.device.api.crypto.keystore.PersistableRIMKeyStore
          extended by net.rim.device.api.crypto.keystore.SyncableRIMKeyStore
All Implemented Interfaces:
CollectionEventSource, KeyStore
Direct Known Subclasses:
DeviceKeyStore, TrustedKeyStore

public class SyncableRIMKeyStore
extends PersistableRIMKeyStore

Implements a key store that receives information through the cradle and saves this information in a key store. When the information is updated, created, or deleted on the desktop these changes will be reflected on the device in the keystore.

For sample code on how to use a key store see: here

See Also:
RIMKeyStore, PersistableRIMKeyStore
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
 
Fields inherited from class net.rim.device.api.crypto.keystore.PersistableRIMKeyStore
_persist
 
Fields inherited from interface net.rim.device.api.crypto.keystore.KeyStore
SECURITY_LEVEL_HIGH, SECURITY_LEVEL_LOW, SECURITY_LEVEL_MEDIUM, SECURITY_LEVEL_NOT_APPLICABLE
 
Constructor Summary
Category: Signed SyncableRIMKeyStore(String syncName, String displayName, long id, CodeSigningKey key, PersistableRIMKeyStoreFactory factory)
          Constructs a keystore that can synchronize with the desktop.
Category: Signed SyncableRIMKeyStore(String syncName, String displayName, long id, CodeSigningKey key, PersistableRIMKeyStoreFactory factory, KeyStore keyStore)
          Constructs a keystore that can synchronize with the desktop.
 
Method Summary
Category: Signed  boolean checkTicket(KeyStoreTicket ticket)
          Checks the validity of the ticket.
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 protected  void set(AssociatedData[] associatedData, KeyStoreData data)
          Override this method in the RIMKeyStore implementation to tell the KeyStoreManager when a certificate has been added so it can update its dirty bit implementation of certificates not yet synchronized with the BES.
 
Methods inherited from class net.rim.device.api.crypto.keystore.PersistableRIMKeyStore
addIndex, changePassword, removeIndex, removeKey
 
Methods inherited from class net.rim.device.api.crypto.keystore.RIMKeyStore
addCollectionListener, addIndices, deleteKey, elements, elements, elements, elements, elements, elements, exists, existsIndex, getBackingKeyStore, getName, isMember, isMember, isMember, isMember, removeCollectionListener, set, set, set, set, set, set, set, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

SyncableRIMKeyStore

public SyncableRIMKeyStore(String syncName,
                           String displayName,
                           long id,
                           CodeSigningKey key,
                           PersistableRIMKeyStoreFactory factory)
                    throws KeyStoreRegisterException
Constructs a keystore that can synchronize with the desktop.

Parameters:
syncName - The name of the keystore that is displayed to the desktop software as a database. This string should NOT be resourced.
displayName - The name that is displayed to the user (or retrieved from the getName method). This string should be resourced.
id - The unique long representing the key store.
key - a CodeSigningKey which can be used to prevent unauthorized access to your keystore.
factory - The factory used to create the key store. See PersistableRIMKeyStore for more information on the unique id.
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).
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

SyncableRIMKeyStore

public SyncableRIMKeyStore(String syncName,
                           String displayName,
                           long id,
                           CodeSigningKey key,
                           PersistableRIMKeyStoreFactory factory,
                           KeyStore keyStore)
                    throws KeyStoreRegisterException
Constructs a keystore that can synchronize with the desktop.

Parameters:
syncName - The name of the keystore that is displayed to the desktop software as a database. This string should NOT be resourced.
displayName - The name that is displayed to the user (or retrieved from the getName method). This string should be resourced.
id - The unique long representing the key store.
key - a CodeSigningKey which can be used to prevent unauthorized access to your keystore.
factory - The factory used to create the key store.
keyStore - An underlying keystore that allows for chaining of key stores similar to how key store works.
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).
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


Method Detail

set

protected void set(AssociatedData[] associatedData,
                   KeyStoreData data)
Override this method in the RIMKeyStore implementation to tell the KeyStoreManager when a certificate has been added so it can update its dirty bit implementation of certificates not yet synchronized with the BES.

Overrides:
set in class RIMKeyStore
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.
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

public KeyStoreTicket getTicket()
                         throws KeyStoreCancelException
Description copied from interface: KeyStore
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.

Specified by:
getTicket in interface KeyStore
Overrides:
getTicket in class RIMKeyStore
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

public KeyStoreTicket getTicket(String prompt)
                         throws KeyStoreCancelException
Description copied from interface: KeyStore
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.

Specified by:
getTicket in interface KeyStore
Overrides:
getTicket in class RIMKeyStore
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.7.0

checkTicket

public boolean checkTicket(KeyStoreTicket ticket)
Description copied from class: RIMKeyStore
Checks the validity of the ticket.

Specified by:
checkTicket in interface KeyStore
Overrides:
checkTicket in class RIMKeyStore
Parameters:
ticket - The specified ticket.
Returns:
A boolean that represents validity of the ticket. Returns true if the ticket is valid, 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





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