5
1: Using smart cards
See “Code sample: Creating a cryptographic smart card object” on page 15 for more information.
Create a cryptographic session for a cryptographic smart card
Retrieve the names of the algorithms that
the smart card supports, for example (“RSA”,
“DSA”).
>
Implement
CryptoSmartCard.getAlgorithms()
.
Retrieve a
CryptoToken
object that
supports the given algorithm.
>
Implement
CryptoSmartCard.getCryptoToken(String)
.
Task
Steps
Create a cryptographic smart
card session for a
cryptographic smart card.
>
Extend the abstract
CryptoSmartCardSession
class.
Close a cryptographic smart
card session.
>
Implement
SmartCardSession.closeImpl()
.
Retrieve the maximum
number of login attempts.
>
Implement
SmartCardSession.getMaxLoginAttemptsImpl()
.
Retrieve the ID for the smart
card.
>
Implement
SmartCardSession.getSmartCardIDImpl()
.
Retrieve the remaining
number of login attempts.
>
Implement
SmartCardSession.getRemainingLoginAttemptsImpl()
.
Attempt to log in to the
cryptographic session using a
given password string.
>
Implement
SmartCardSession.loginImpl(String)
.
Retrieve the certificates from
the smart card.
>
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, implement
CryptoSmartCardSession.getKeyStoreDataArrayImpl()
as follows:
RSACryptoToken token = new MyRSACryptoToken();
RSACryptoSystem cryptoSystem = new RSACryptoSystem(token, 1024);
RSAPrivateKey privateKey;
PrivateKey privateKey = new RSAPrivateKey(cryptoSystem, new
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,
implement the
getKeyStoreDataArrayImp
method as follows:
PrivateKey privateKey = CryptoSmartCardUtilities2.createPrivateKey(token,
1024, new MyCryptoTokenData());
Validate the input
parameters in the
cryptographic session.
>
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, in your implementation of the
signDecrypt
method, validate the parameters as follows:
int modulusLength = cryptoSystem.getModulusLength();
•
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,
in your implementation of the
signDecrypt
method, validate the parameters as follows:
int modulusLength = (cryptoSystem.getBitLength()/8);
Task
Steps
Содержание JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE
Страница 4: ......
Страница 6: ......
Страница 14: ...10 Cryptographic Smart Card Driver Development Guide...
Страница 17: ...13 2 Testing a cryptographic smart card driver...
Страница 18: ...14 Cryptographic Smart Card Driver Development Guide...
Страница 34: ...30 Cryptographic Smart Card Driver Development Guide...
Страница 35: ......
Страница 36: ...2007 Research In Motion Limited Published in Canada...