|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.smartcard.SmartCardSession
net.rim.device.api.crypto.CryptoSmartCardSession
public abstract class CryptoSmartCardSession
The CryptoSmartCardSession
class should be extended by all cryptographic smart cards.
Field Summary |
---|
Constructor Summary | ||
---|---|---|
|
protected |
CryptoSmartCardSession(SmartCard smartCard,
SmartCardReaderSession readerSession)
Constructs a new CryptoSmartCardSession object. |
Method Summary | ||
---|---|---|
|
protected void |
dismissProgressDialog()
Closes the progress bar. |
|
protected void |
displayProgressDialog(String title,
int numSteps)
Displays a progress dialog. |
|
CryptoSmartCardKeyStoreData[] |
getKeyStoreDataArray()
Returns an array of KeyStoreData associated with the keys stored on the card. |
|
CryptoSmartCardKeyStoreData[] |
getKeyStoreDataArray(boolean allowCancel)
Returns an array of KeyStoreData associated with the keys stored on the card. |
|
protected abstract CryptoSmartCardKeyStoreData[] |
getKeyStoreDataArrayImpl()
Returns an array of KeyStoreData associated with the keys stored on the card. |
|
protected CryptoSmartCardKeyStoreData[] |
getKeyStoreDataArrayImpl(boolean allowCancel)
Returns an array of KeyStoreData associated with the keys stored on the card. |
|
void |
getRandomBytes(byte[] buffer)
Generates random bytes, filling the given buffer entirely. |
|
void |
getRandomBytes(byte[] buffer,
int offset,
int length)
Inserts random bytes into the given buffer starting at the specified array index offset. |
|
byte[] |
getRandomBytes(int length)
Generates a specified length of random bytes, returning them as a byte array of the specified size. |
|
protected abstract byte[] |
getRandomBytesImpl(int maxNumBytes)
Returns random bytes of data from the smart cards internal RNG. |
|
protected void |
setProgressDialog(int value)
Sets the progress bar at a particular value. |
|
protected void |
stepProgressDialog(int delta)
Increments the progress bar. |
Methods inherited from class net.rim.device.api.smartcard.SmartCardSession |
---|
close, closeImpl, getFingerprints, getFingerprintsImpl, getMaxLoginAttempts, getMaxLoginAttemptsImpl, getRemainingLoginAttempts, getRemainingLoginAttemptsImpl, getSmartCard, getSmartCardID, getSmartCardIDImpl, getSmartCardReaderSession, isLoggedIn, isOpen, login, loginImpl, loginPrompt, sendAPDU |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected CryptoSmartCardSession(SmartCard smartCard, SmartCardReaderSession readerSession)
CryptoSmartCardSession
object.
smartCard
- The SmartCard
to use.readerSession
- The SmartCardReaderSession
to use.Method Detail |
---|
public final CryptoSmartCardKeyStoreData[] getKeyStoreDataArray() throws SmartCardException, CryptoTokenException
KeyStoreData
associated with the keys stored on the card.
SmartCardException
- Thrown if an error occurs when communicating with the smart card.
CryptoTokenException
- Thrown if there is a token related problem.
SmartCardSessionClosedException
- Thrown if this session is closed.public final CryptoSmartCardKeyStoreData[] getKeyStoreDataArray(boolean allowCancel) throws SmartCardException, CryptoTokenException
KeyStoreData
associated with the keys stored on the card.
allowCancel
- true
if the user is allowed to cancel the operation
SmartCardException
- Thrown if an error occurs when communicating with the smart card.
CryptoTokenException
- Thrown if there is a token related problem.
SmartCardSessionClosedException
- Thrown if this session is closed.protected abstract CryptoSmartCardKeyStoreData[] getKeyStoreDataArrayImpl() throws SmartCardException, CryptoTokenException
KeyStoreData
associated with the keys stored on the card.
The array should contain all the private keys (or references to), symmetric keys (or references to), public keys and certificates on the card.
If a KeyStoreData contains public keys, they must be valid PublicKeys. Public key cryptographic operations will be handled by the device and not by the smartcard.
If the key store contains certificates, they must be valid Certificates.
SmartCardException
- Thrown if an error occurs when communicating with the smart card.
CryptoTokenException
- Thrown if there is a token related problem.
SmartCardSessionClosedException
- Thrown if this session is closed.protected CryptoSmartCardKeyStoreData[] getKeyStoreDataArrayImpl(boolean allowCancel) throws SmartCardException, CryptoTokenException
KeyStoreData
associated with the keys stored on the card.
The array should contain all the private keys (or references to), symmetric keys (or references to), public keys and certificates on the card.
If a KeyStoreData contains public keys, they must be valid PublicKeys. Public key cryptographic operations will be handled by the device and not by the smartcard.
If the key store contains certificates, they must be valid Certificates.
The default behaviour of this method is equivalent to CryptoSmartCardSession.getKeyStoreDataArrayImpl()
with the
allowCancel
parameter being ignored.
allowCancel
- true
if the user is allowed to cancel the operation
SmartCardException
- Thrown if an error occurs when communicating with the smart card.
CryptoTokenException
- Thrown if there is a token related problem.
SmartCardSessionClosedException
- Thrown if this session is closed.protected void displayProgressDialog(String title, int numSteps)
getKeyStoreDataArrayImpl()
, to indicate progress to the user.
If a progress dialog is currently displayed, then it is dismissed and the new dialog is displayed.
Note: Be sure to call dismissProgressDialog().
title
- A short String to describe the operationnumSteps
- The maximum number of steps to be performedprotected void stepProgressDialog(int delta)
delta
- The number of steps to increment the progress bar.protected void setProgressDialog(int value)
value
- The new value of the progress bar.protected void dismissProgressDialog()
public final void getRandomBytes(byte[] buffer, int offset, int length) throws SmartCardException
buffer
- The buffer to store the random bytes. Must be non-null.offset
- The start, or initial position, of the data within the buffer.length
- The number of random bytes to store.
SmartCardException
- Thrown if an error occurs when communicating with the smart card.
SmartCardSessionClosedException
- Thrown if this session is closed.
SmartCardUnsupportedOperationException
- Thrown if the card does not support returning random bytespublic final byte[] getRandomBytes(int length) throws SmartCardException
length
- The number of random bytes to generate.
SmartCardException
- Thrown if an error occurs when communicating with the smart card.
SmartCardSessionClosedException
- Thrown if this session is closed.
SmartCardUnsupportedOperationException
- Thrown if the card does not support returning random bytespublic final void getRandomBytes(byte[] buffer) throws SmartCardException
buffer
- The byte array to fill with random bytes. Must be non-null.
SmartCardException
- Thrown if an error occurs when communicating with the smart card.
SmartCardSessionClosedException
- Thrown if this session is closed.
SmartCardUnsupportedOperationException
- Thrown if the card does not support returning random bytesprotected abstract byte[] getRandomBytesImpl(int maxNumBytes) throws SmartCardException
maxNumBytes
- The maximum number of random bytes to retrieve. The value will be greater than zero.
SmartCardException
- Thrown if an error occurs when communicating with the smart card.
SmartCardSessionClosedException
- Thrown if this session is closed.
SmartCardUnsupportedOperationException
- Thrown if the card does not support returning random bytes
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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