|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.crypto.keystore.RIMKeyStore
public class 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
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.
PersistableRIMKeyStore
,
SyncableRIMKeyStore
Field Summary |
---|
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 | ||
---|---|---|
|
|
RIMKeyStore(String name)
This constructor allows the developer to create a key store with no underlying keystore. |
|
protected |
RIMKeyStore(String name,
String className,
long id,
CodeSigningKey key,
KeyStore keyStore)
A protected constructor used for the subclasses who extend this class directly. |
|
protected |
RIMKeyStore(String name,
String className,
long id,
CodeSigningKey key,
KeyStore keyStore,
Vector vector)
|
|
|
RIMKeyStore(String name,
KeyStore keyStore)
This constructor allows one to create a key store with an underlying key store. |
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. |
|
protected void |
deleteKey(KeyStoreData data)
A protected function to allow a subclass to remove a key without a ticket prompt. |
|
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(Key key)
Returns a boolean dictating whether or not this key 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(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 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,
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. |
|
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. |
|
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. |
|
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. |
|
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 |
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.protected RIMKeyStore(String name, String className, long id, CodeSigningKey key, KeyStore keyStore, Vector vector) throws KeyStoreRegisterException
KeyStoreRegisterException
Method Detail |
---|
public KeyStoreData set(AssociatedData[] associatedData, String label, PrivateKey privateKey, String privateKeyEncodingAlgorithm, int securityLevel, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStore
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.
set
in interface KeyStore
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.
High | The user will be asked for a passphrase |
Low | The 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).
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.
InvalidKeyException
- Thrown when the specified key is invalid.
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.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
KeyStore
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.
set
in interface KeyStore
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.
High | The user will be asked for a passphrase |
Low | The 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).
NoSuchAlgorithmException
- Thrown when the specified cipher is invalid.
InvalidKeyEncodingException
- Thrown when the specified key is
improperly formatted.
InvalidKeyException
- Thrown when the specified key is invalid.
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.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
KeyStore
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.
set
in interface KeyStore
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.
High | The user will be asked for a passphrase |
Low | The 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).
NoSuchAlgorithmException
- Thrown when the specified cipher is invalid.
InvalidKeyEncodingException
- Thrown when the specified key is
improperly formatted.
InvalidKeyException
- Thrown when the specified key is invalid.
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.public KeyStoreData set(AssociatedData[] associatedData, String label, PublicKey publicKey, long keyUsage, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStore
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.
set
in interface KeyStore
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).
NoSuchAlgorithmException
- Thrown when the specified cipher is invalid.
InvalidKeyEncodingException
- Thrown when the specified key is
improperly formatted.
InvalidKeyException
- Thrown when the specified key is invalid.
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.public KeyStoreData set(AssociatedData[] associatedData, String label, Certificate certificate, CertificateStatus certStatus, KeyStoreTicket ticket) throws NoSuchAlgorithmException, InvalidKeyEncodingException, InvalidKeyException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreCancelException
KeyStore
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.
set
in interface KeyStore
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).
NoSuchAlgorithmException
- Thrown when the specified cipher is invalid.
InvalidKeyEncodingException
- Thrown when the specified key is
improperly formatted.
InvalidKeyException
- Thrown when the specified key is invalid.
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.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
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
KeyStore
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.
set
in interface KeyStore
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.
High | The user will be asked for a passphrase |
Low | The 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).
NoSuchAlgorithmException
- Thrown when the specified cipher is invalid.
InvalidKeyEncodingException
- Thrown when the specified key is
improperly formatted.
InvalidKeyException
- Thrown when the specified key is invalid.
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.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)
KeyStore
elements
in interface KeyStore
index
- A string representing the Index class that
denotes where to find the alias and how it is used.target
- An object denoting which key store information
should be returned.
KeyStoreData
objects.public Enumeration elements(long index, Object target, boolean backingKeyStore)
KeyStore
elements
in interface KeyStore
index
- A string representing the Index class that
denotes where to find the alias and how it is used.target
- 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.
KeyStoreData
objects.public void removeKey(KeyStoreData data, KeyStoreTicket ticket) throws KeyStoreCancelException
KeyStore
removeKey
in interface KeyStore
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).
KeyStoreCancelException
- Thrown if the user fails to enter a password.protected final void deleteKey(KeyStoreData data)
data
- The KeystoreData to remove.public Enumeration elements()
KeyStore
KeyStoreData[]
that are stored in the KeyStore. Note that this function will
not return any elements from the backing keystore.
elements
in interface KeyStore
KeyStoreData
objects.public Enumeration elements(boolean backingKeyStore)
KeyStore
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.
elements
in interface KeyStore
KeyStoreData
objects.public Enumeration elements(long index)
KeyStore
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.
elements
in interface KeyStore
index
- A long representing what index to return
an enumeration of the elements for.
KeyStoreData
items.public Enumeration elements(long index, boolean backingKeyStore)
KeyStore
KeyStoreData
inside the key store according to the index provided
with the parameter.
elements
in interface KeyStore
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.
KeyStoreData
items.public boolean exists(long index, Object target)
KeyStore
exists
in interface KeyStore
index
- The long denoting the index class.target
- An object representing the alias to the key store
information.
public boolean addIndex(KeyStoreIndex index)
KeyStore
addIndex
in interface KeyStore
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.
public void addIndices(KeyStoreIndex[] indices)
KeyStore
addIndices
in interface KeyStore
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.public void removeIndex(long index)
KeyStore
removeIndex
in interface KeyStore
index
- The long denoting the index class to remove.public boolean existsIndex(long index)
KeyStore
existsIndex
in interface KeyStore
index
- The long representing the index.
public int size()
KeyStore
size
in interface KeyStore
public void changePassword() throws KeyStoreDecodeRuntimeException
KeyStore
KeyStoreData
items in the
keystore.
changePassword
in interface KeyStore
KeyStoreDecodeRuntimeException
public String getName()
KeyStore
getName
in interface KeyStore
public boolean isMember(Certificate certificate)
KeyStore
KeyStore
.
Note: This does not check the underlying keystore.
isMember
in interface KeyStore
certificate
- The specified certificate.
public boolean isMember(byte[] certificateEncoding)
KeyStore
KeyStore
.
Note: This does not check the underlying keystore.
isMember
in interface KeyStore
certificateEncoding
- The encoding of the specified certificate.
public boolean isMember(Key key)
KeyStore
KeyStore
.
Note that a key can represent a PublicKey, PrivateKey, or SymmetricKey at this time.
Note: This does not check the underlying keystore.
isMember
in interface KeyStore
key
- The specified key.
public boolean isMember(KeyStoreData data)
KeyStore
KeyStoreData
is contained inside
the KeyStore
.
Note: This does not check the underlying keystore.
isMember
in interface KeyStore
data
- The key store data.
public KeyStoreTicket getTicket() throws KeyStoreCancelException
KeyStore
This method may prompt for a passphrase from the user.
getTicket
in interface KeyStore
KeyStoreCancelException
- Thrown when the user fails to enter a password
or decides to cancel the password entry operation.public KeyStoreTicket getTicket(String prompt) throws KeyStoreCancelException
KeyStore
This method may prompt for a passphrase from the user.
getTicket
in interface KeyStore
prompt
- an additional string provided to the allow the application developer to customize
the ticket prompt dialog to better fit their application needs.
KeyStoreCancelException
- Thrown when the user fails to enter a password
or decides to cancel the password entry operation.public boolean checkTicket(KeyStoreTicket ticket)
checkTicket
in interface KeyStore
ticket
- The specified ticket.
public void addCollectionListener(Object listener)
KeyStoreData
object.
addCollectionListener
in interface CollectionEventSource
addCollectionListener
in interface KeyStore
listener
- Object to register as a listener which must implement
CollectionListener
or one of its derived interfaces.CollectionEventSource.addCollectionListener(java.lang.Object)
public void removeCollectionListener(Object listener)
KeyStoreData
object.
removeCollectionListener
in interface CollectionEventSource
removeCollectionListener
in interface KeyStore
listener
- Listener to remove.CollectionEventSource.removeCollectionListener(java.lang.Object)
public KeyStore getBackingKeyStore()
KeyStore
getBackingKeyStore
in interface KeyStore
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.