|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.crypto.keystore.RIMKeyStore
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
PersistableRIMKeyStore,
SyncableRIMKeyStore| Field Summary | ||
|
protected Vector |
_vector
A vector holding all of the key store data objects inside this keystore. |
| Fields inherited from interface net.rim.device.api.crypto.keystore.KeyStore |
SECURITY_LEVEL_HIGH, SECURITY_LEVEL_LOW |
| Constructor Summary | ||
|
|
RIMKeyStore(String name)
This constructor allows the developer to create a key store with no underlying keystore. |
|
|
RIMKeyStore(String name,
KeyStore keyStore)
This constructor allows one to create a key store with an underlying key store. |
|
protected |
RIMKeyStore(String name,
String className,
long id,
CodeSigningKey key,
KeyStore keyStore)
A protected constructor used for the subclasses who extend this class directly. |
| Method Summary | ||
|
void |
addCollectionListener(Object listener)
Registers a listener to receive collection events. |
|
boolean |
addIndex(KeyStoreIndex index)
Adds an index to all of the information currently in the key store. |
|
void |
addIndices(KeyStoreIndex[] indices)
Adds an array of indices to the key store. |
|
void |
changePassword()
Changes the password for the underlying private keys in each of the KeystoreData classes and should NOT be called directly. |
|
boolean |
checkTicket(KeyStoreTicket ticket)
Checks the validity of the ticket. |
|
Enumeration |
elements()
Returns an enumeration of all the KeyStoreData[]
that are stored in the KeyStore. |
|
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. |
|
Enumeration |
elements(long index)
Returns an enumeration of all the elements KeyStoreData
inside the key store according to the index provided
with the parameter. |
|
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. |
|
Enumeration |
elements(long index,
Object target)
Returns an array of keystore information that contains the certificates, keys and other data associated with this alias. |
|
Enumeration |
elements(long index,
Object target,
boolean backingKeyStore)
Returns an array of keystore information that contains the certificates, keys and other data associated with this alias. |
|
boolean |
exists(long index,
Object target)
Returns a boolean denoting whether an object exists with the given alias and the given index class. |
|
boolean |
existsIndex(long index)
Returns a boolean denoting whether this index already exists in the key store. |
|
KeyStore |
getBackingKeyStore()
This method returns the backing keystore if it exists. |
|
String |
getName()
Returns the name of the key store. |
|
KeyStoreTicket |
getTicket()
Returns a ticket that allows the caller to use the keystore without prompting the user for their password. |
|
KeyStoreTicket |
getTicket(String prompt)
Returns a ticket that allows the caller to use the keystore without prompting the user for their password. |
|
boolean |
isMember(byte[] certificateEncoding)
Returns a boolean dictating whether or not this certificate is contained inside the KeyStore.
|
|
boolean |
isMember(Certificate certificate)
Returns a boolean dictating whether or not this certificate is contained inside the KeyStore.
|
|
boolean |
isMember(Key key)
Returns a boolean dictating whether or not this key is contained inside the KeyStore.
|
|
boolean |
isMember(KeyStoreData data)
Returns a boolean dictating whether or not this KeyStoreData is contained inside
the KeyStore.
|
|
void |
removeCollectionListener(Object listener)
Removes a listener object from the list of those receiving events. |
|
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. |
|
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. |
|
protected void |
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.
|
|
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.
|
|
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.
|
|
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.
|
|
protected KeyStoreData |
set(AssociatedData[] associatedData,
String label,
PrivateKey privateKey,
String privateKeyEncodingAlgorithm,
int securityLevel,
PublicKey publicKey,
long keyUsage,
Certificate certificate,
CertificateStatus status,
KeyStoreTicket ticket)
|
|
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.
|
|
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.
|
|
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.
|
|
int |
size()
Returns the number of elements inside the key store. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Vector _vector
| Constructor Detail |
public RIMKeyStore(String name) throws KeyStoreRegisterException
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.
name - An identifying name for the keystore that can be displayed to the user.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).public RIMKeyStore(String name, KeyStore keyStore) throws KeyStoreRegisterException
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.
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.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).protected RIMKeyStore(String name, String className, long id, CodeSigningKey key, KeyStore keyStore) throws KeyStoreRegisterException
It allows for a string for registration info to be sent down and to ensure that only one registration request needs to occur.
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.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).KeyStoreRegisterException - Thrown if the class could not be instantiated correctly.| Method Detail |
public KeyStoreData set(AssociatedData[] associatedData, String label, PrivateKey privateKey, String privateKeyEncodingAlgorithm, int securityLevel, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStoreKeyStoreData 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.
public KeyStoreData set(AssociatedData[] associatedData, String label, PrivateKey privateKey, String privateKeyEncodingAlgorithm, int securityLevel, PublicKey publicKey, long keyUsage, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStoreKeyStoreData 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.
public KeyStoreData set(AssociatedData[] associatedData, String label, PrivateKey privateKey, String privateKeyEncodingAlgorithm, int securityLevel, Certificate certificate, CertificateStatus certStatus, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStoreKeyStoreData 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.
public KeyStoreData set(AssociatedData[] associatedData, String label, PublicKey publicKey, long keyUsage, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStoreKeyStoreData 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.
public KeyStoreData set(AssociatedData[] associatedData, String label, Certificate certificate, CertificateStatus certStatus, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStoreKeyStoreData 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.
protected KeyStoreData set(AssociatedData[] associatedData, String label, PrivateKey privateKey, String privateKeyEncodingAlgorithm, int securityLevel, PublicKey publicKey, long keyUsage, Certificate certificate, CertificateStatus status, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
public KeyStoreData set(AssociatedData[] associatedData, String label, SymmetricKey symmetricKey, String symmetricKeyEncodingAlgorithm, int securityLevel, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStoreKeyStoreData 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.
protected void set(AssociatedData[] associatedData, KeyStoreData data)
KeyStoreData class containing the information
that will be associated with the array of aliases contained
inside this class.
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.public Enumeration elements(long index, Object target)
KeyStorepublic Enumeration elements(long index, Object target, boolean backingKeyStore)
KeyStorepublic void removeKey(KeyStoreData data, KeyStoreTicket ticket) throws KeyStoreCancelException
KeyStorepublic Enumeration elements()
KeyStoreKeyStoreData[]
that are stored in the KeyStore. Note that this function will
not return any elements from the backing keystore.
net.rim.device.api.crypto.keystore.KeyStoreKeyStoreData objects.public Enumeration elements(boolean backingKeyStore)
KeyStoreKeyStoreData
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.
public Enumeration elements(long index)
KeyStoreKeyStoreData
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.public Enumeration elements(long index, boolean backingKeyStore)
KeyStoreKeyStoreData
inside the key store according to the index provided
with the parameter.
public boolean exists(long index,
Object target)
KeyStorepublic boolean addIndex(KeyStoreIndex index)
KeyStorepublic void addIndices(KeyStoreIndex[] indices)
KeyStoreaddIndices in interface KeyStorepublic void removeIndex(long index)
KeyStoreremoveIndex in interface KeyStorepublic boolean existsIndex(long index)
KeyStoreexistsIndex in interface KeyStorepublic int size()
KeyStorenet.rim.device.api.crypto.keystore.KeyStorepublic void changePassword()
KeyStoreKeyStoreData items in the
keystore.changePassword in interface KeyStorepublic String getName()
KeyStorenet.rim.device.api.crypto.keystore.KeyStorepublic boolean isMember(Certificate certificate)
KeyStoreKeyStore.
Note: This does not check the underlying keystore.
public boolean isMember(byte[] certificateEncoding)
KeyStoreKeyStore.
Note: This does not check the underlying keystore.public boolean isMember(Key key)
KeyStoreKeyStore.
Note that a key can represent a PublicKey, PrivateKey, or SymmetricKey at this time.
Note: This does not check the underlying keystore.
public boolean isMember(KeyStoreData data)
KeyStoreKeyStoreData is contained inside
the KeyStore.
Note: This does not check the underlying keystore.
public KeyStoreTicket getTicket() throws KeyStoreCancelException
KeyStoreThis method may prompt for a passphrase from the user.
net.rim.device.api.crypto.keystore.KeyStoreKeyStoreCancelException - Thrown when the user fails to enter a password
or decides to cancel the password entry operation.public KeyStoreTicket getTicket(String prompt) throws KeyStoreCancelException
KeyStoreThis method may prompt for a passphrase from the user.
public boolean checkTicket(KeyStoreTicket ticket)
checkTicket in interface KeyStoreticket - The specified ticket.public void addCollectionListener(Object listener)
KeyStoreData object.
addCollectionListener in interface KeyStorelistener - Object to register as a listener which must implement
CollectionListener or one of its derived interfaces.public void removeCollectionListener(Object listener)
KeyStoreData object.
removeCollectionListener in interface KeyStorelistener - Listener to remove.public KeyStore getBackingKeyStore()
KeyStoregetBackingKeyStore in interface KeyStorenet.rim.device.api.crypto.keystore.KeyStore
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.