SHOW Signed SHOW CryptoExtensionAPI
 

net.rim.device.api.crypto
Class CryptoSmartCardSession

java.lang.Object
  |
  +--net.rim.device.api.smartcard.SmartCardSession
        |
        +--net.rim.device.api.crypto.CryptoSmartCardSession

public abstract class CryptoSmartCardSession
extends SmartCardSession

The CryptoSmartCardSession class should be extended by all cryptographic smart cards.

Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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:
JDE 4.1.0

Field Summary
 
Fields inherited from class net.rim.device.api.smartcard.SmartCardSession
DECRYPT_OPERATION, INS_APPEND_RECORD, INS_ENVELOPE, INS_ERASE_BINARY, INS_EXTERNAL_AUTHENTICATE, INS_GET_CHALLENGE, INS_GET_DATA, INS_GET_RESPONSE, INS_INTERNAL_AUTHENTICATE, INS_MANAGE_CHANNEL, INS_PUT_DATA, INS_READ_BINARY, INS_READ_RECORD, INS_SELECT_FILE, INS_UPDATE_BINARY, INS_UPDATE_RECORD, INS_VERIFY, INS_WRITE_BINARY, INS_WRITE_RECORD, KEY_GENERATION_OPERATION, NON_CRYPTO_OPERATION, SIGN_OPERATION, UNKNOWN_OPERATION, USER_AUTHENTICATION_OPERATION
 
Constructor Summary
 Category: CryptoExtensionAPI Category: Signed protected CryptoSmartCardSession(SmartCard smartCard, SmartCardReaderSession readerSession)
          Constructs a new CryptoSmartCardSession object.
 
Method Summary
 Category: CryptoExtensionAPI Category: Signed protected  void dismissProgressDialog()
          Closes the progress bar.
 Category: CryptoExtensionAPI Category: Signed protected  void displayProgressDialog(String title, int numSteps)
          Displays a progress dialog.
 Category: CryptoExtensionAPI Category: Signed  CryptoSmartCardKeyStoreData[] getKeyStoreDataArray()
          Returns an array of KeyStoreData associated with the keys stored on the card.
 Category: CryptoExtensionAPI Category: Signed protected abstract  CryptoSmartCardKeyStoreData[] getKeyStoreDataArrayImpl()
          Returns an array of KeyStoreData associated with the keys stored on the card.
 Category: CryptoExtensionAPI Category: Signed  void getRandomBytes(byte[] buffer)
          Generates random bytes, filling the given buffer entirely.
 Category: CryptoExtensionAPI Category: Signed  void getRandomBytes(byte[] buffer, int offset, int length)
          Inserts random bytes into the given buffer starting at the specified array index offset.
 Category: CryptoExtensionAPI Category: Signed  byte[] getRandomBytes(int length)
          Generates a specified length of random bytes, returning them as a byte array of the specified size.
 Category: CryptoExtensionAPI Category: Signed protected abstract  byte[] getRandomBytesImpl(int maxNumBytes)
          Returns random bytes of data from the smart cards internal RNG.
 Category: CryptoExtensionAPI Category: Signed protected  void setProgressDialog(int value)
          Sets the progress bar at a particular value.
 Category: CryptoExtensionAPI Category: Signed protected  void stepProgressDialog(int delta)
          Increments the progress bar.
 
Methods inherited from class net.rim.device.api.smartcard.SmartCardSession
close, closeImpl, 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

CryptoSmartCardSession

protected CryptoSmartCardSession(SmartCard smartCard,
                                 SmartCardReaderSession readerSession)
Constructs a new CryptoSmartCardSession object.

Parameters:
smartCard - The SmartCard to use.
readerSession - The SmartCardReaderSession to use.
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.
Method Detail

dismissProgressDialog

protected void dismissProgressDialog()
Closes the progress bar.
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

displayProgressDialog

protected void displayProgressDialog(String title,
                                     int numSteps)
Displays a progress dialog. This method can be used by subclasses during long operations, such as 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().

Parameters:
title - A short String to describe the operation
numSteps - The maximum number of steps to be performed
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getKeyStoreDataArray

public final CryptoSmartCardKeyStoreData[] getKeyStoreDataArray()
                                                         throws SmartCardException,
                                                                CryptoTokenException
Returns an array of KeyStoreData associated with the keys stored on the card.
Throws:
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.
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getKeyStoreDataArrayImpl

protected abstract CryptoSmartCardKeyStoreData[] getKeyStoreDataArrayImpl()
                                                                   throws SmartCardException,
                                                                          CryptoTokenException
Returns an array of 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 keystore contains certificates, they must be valid Certificates.

Throws:
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.
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getRandomBytes

public final void getRandomBytes(byte[] buffer)
                          throws SmartCardException
Generates random bytes, filling the given buffer entirely.

Parameters:
buffer - The byte array to fill with random bytes. Must be non-null.
Throws:
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
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getRandomBytes

public final void getRandomBytes(byte[] buffer,
                                 int offset,
                                 int length)
                          throws SmartCardException
Inserts random bytes into the given buffer starting at the specified array index offset.

Parameters:
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.
Throws:
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
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getRandomBytes

public final byte[] getRandomBytes(int length)
                            throws SmartCardException
Generates a specified length of random bytes, returning them as a byte array of the specified size.

Parameters:
length - The number of random bytes to generate.
Returns:
A byte array containing the random bytes.
Throws:
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
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

getRandomBytesImpl

protected abstract byte[] getRandomBytesImpl(int maxNumBytes)
                                      throws SmartCardException
Returns random bytes of data from the smart cards internal RNG. The number of bytes returned should be less than or equal to maxNumBytes. The calling methods will take care of calling this method until the correct number of bytes are retrieved.
Parameters:
maxNumBytes - The maximum number of random bytes to retrieve. The value will be greater than zero.
Returns:
The random bytes. The number of bytes returned may be less than numBytes.
Throws:
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
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

setProgressDialog

protected void setProgressDialog(int value)
Sets the progress bar at a particular value.
Parameters:
value - The new value of the progress bar.
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.

stepProgressDialog

protected void stepProgressDialog(int delta)
Increments the progress bar.
Parameters:
delta - The number of steps to increment the progress bar.
Since:
JDE 4.1.0
Category:
CryptoExtensionAPI: This element is part of the Crypto Extension API. These APIs are intended for parties interested in extending the security provider frameworks, such as integrating a new security medium.
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.



Copyright 1999-2009 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.