8
Cryptographic Smart Card Driver Development Guide
See “Code sample: Enabling a CryptoToken object for RSA operations using a private key” on page 24 for more
information.
Store the location of the private key file
Even though the private key file is stored on the smart card, the BlackBerry device needs to know that a private key
file exists for a certificate. A class that implements the
CryptoTokenPrivateKeyData
interface can act as a
pointer to a private key file on the smart card.
Enable signing 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 signs unprocessed data, for example:
public void signRSA(RSACryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData, byte[] input, int
inputOffset,byte[] output, int outputOffset)
throws CryptoTokenException, CryptoUnsupportedOperationException
{
signDecryptHelper(cryptoSystem, privateKeyData, input, inputOffset,
output, outputOffset, SIGN_DESC, SmartCardSession.SIGN_OPERATION);
}
•
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 signs unprocessed data, for example:
public void signRSASmartCardImpl (CryptoSystem cryptoSystem,
CryptoTokenPrivateKeyData privateKeyData, byte[] input,int
inputOffset, byte[] output, int outputOffset)
Task
Steps
Store the location of the private key file on
the smart card.
>
Implement the
CryptoTokenPrivateKeyData
interface.
Associate the implementing class object
with the smart card that contains the
private key file.
1.
Create an instance variable for storing the smart card ID.
private SmartCardID _id;
2. Create an instance variable for storing the location of the private key file on the smart card.
private byte _file;
3. Create a constructor that associates an object from the class that implements a
PrivateKeyData
interface with the smart card.
public MyCryptoTokenData(SmartCardID id, byte file)
{
_id = id;
_file = file;
}
Retrieve the ID of the smart card.
>
Create a method that returns the
SmartCardID
instance variable.
public SmartCardID getSmartCardID()
{
return _id;
}
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...