7
1: Using smart cards
Determine if the token object and the
CryptoSystem
support the type of
encryption scheme.
>
Perform one of the following steps:
•
To create a cryptographic smart card driver that is compatible with BlackBerry Device
Software Version 4.2 or later, create a method that returns a Boolean value that indicates if
the token object supports the specified encryption scheme.
public boolean isSupportedDecryptRSA(RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData)throws
CryptoTokenException
{
return privateKeyData instanceof MyCryptoTokenData;
}
•
To create a cryptographic smart card driver that is compatible with BlackBerry Device
Software Version 4.1 and Version 4.2 or later, and to include the cryptographic smart card
driver in two-factor authentication, create a method that returns a Boolean value that
indicates if the token object supports the specified encryption scheme.
public boolean isSupportedDecryptRSASmartCardImpl( CryptoSystem
cryptoSystem,CryptoTokenPrivateKeyData privateKeyData);
Enable decryption of unprocessed data.
>
Perform one of the following steps:
•
To create a cryptographic smart card driver that is compatible with BlackBerry Device
Software Version 4.2 or later, create a method that performs decryption of unprocessed data,
for example:
public void decryptRSA(RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData,byte[] input, int
inputOffset,
byte[] output, int outputOffset)throws CryptoTokenException
{
try {//signDecryptHelper is a private helper method.
signDecryptHelper(cryptoSystem, privateKeyData, input, inputOffset,
output, outputOffset, DECRYPT_DESC,
SmartCardSession.DECRYPT_OPERATION);
}
catch (CryptoUnsupportedOperationException e) {
throw new CryptoTokenException(e.toString());
}
}
•
To create a cryptographic smart card driver that is compatible with BlackBerry Device
Software Version 4.1 and Version 4.2 or later, and to include the cryptographic smart card
driver in two-factor authentication, create a method that performs decryption of unprocessed
data, for example:
public void decryptRSASmartCardImplCryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData, byte[] input, int
inputOffset, byte[] output,int outputOffset)
Task
Steps
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...