Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Manual page 21

Cryptographic smart card driver
Table of Contents

Advertisement

/**
* Retrieves this smart card's capabilities
*/
protected SmartCardCapabilities getCapabilitiesImpl()
{
return new SmartCardCapabilities( SmartCardCapabilities.PROTOCOL_T0 );
}
/**
* Determine if this smart card can display its settings.
*/
protected boolean isDisplaySettingsAvailableImpl( Object context )
{
return true;
}
/**
* Display this smart card's settings.
* This method will be invoked from the smart card options screen when
* the user selects the driver and chooses to view the settings of that driver.
*
* This method could be called from the event thread. The driver should not block
* the event thread for long periods of time.
*
* @param context Reserved for future use.
*/
protected void displaySettingsImpl( Object context )
{
Dialog.alert( DISPLAY_SETTINGS );
}
/** Retrieve the algorithms supported by this smart card.
*
* @return one or more of "RSA", "DSA", or "ECC"
*/
public String[] getAlgorithms()
{
return new String [] { RSA };
}
/** Retrieve a crypto token that supports the given algorithm.
* @param algorithm Name of the algorithm.
*
* @return Crypto Token supporting the named algorithm.
*
* @throws NoSuchAlgorithmException If the specified algorithm is invalid.
* @throws CryptoTokenException If there is a token-related problem.
*/
public CryptoToken getCryptoToken( String algorithm ) throws NoSuchAlgorithmException,
CryptoTokenException
{
if ( algorithm.equals( RSA ) ) {
3: Code samples
17

Advertisement

Table of Contents
loading

This manual is also suitable for:

Java development environment 4.6.0

Table of Contents