17
3: Code samples
/**
* 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 ) ) {
Summary of Contents for JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE
Page 4: ......
Page 6: ......
Page 14: ...10 Cryptographic Smart Card Driver Development Guide...
Page 17: ...13 2 Testing a cryptographic smart card driver...
Page 18: ...14 Cryptographic Smart Card Driver Development Guide...
Page 34: ...30 Cryptographic Smart Card Driver Development Guide...
Page 35: ......
Page 36: ...2007 Research In Motion Limited Published in Canada...