Implement a class to enable a communication session with a smart card

  1. Import the required crypto and smartcard libraries.
  2. Extend the abstract CryptoSmartCardSession class.
  3. Implement CryptoSmartCardSession.getKeyStoreDataArrayImpl() according to the BlackBerry Device Software version of the target device.
    • 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());
      
  4. Implement CryptoSmartCardSession.getKeyStoreDataArrayImpl()
  5. Implement the other required CryptoSmartCardSession methods.

Was this information helpful? Send us your comments.