51

I am writing an app for BlackBerry that utilizes a BlackBerry smartcard reader. There is not much documentation on the subject, so I'd really like if someone could give me starting examples.

Basically, there is one RSA private key on the card plus a certificate (for paired public key). I would like to be able to encrypt/decrypt data and also sign it as well. The final goal would be to establish an mutual-authenticated SSL connection using client certificate contained on the smartcard.

Here is the code I managed to come up with so far:

SmartCardReader btReader = null;
SmartCardReader[] readers = SmartCardReaderFactory.getInstalledReaders();
for (int i = 0; i < readers.length; i++) {
    SmartCardReader reader = readers[i];
    if (reader.getType().equalsIgnoreCase("bluetooth")) {
        btReader = reader;
        break;
    }
}

SmartCardReaderSession readerSession = reader.openSession();
CryptoSmartCard card = (CryptoSmartCard) readerSession.getSmartCard();
RSACryptoToken token = (RSACryptoToken) card.getCryptoToken("RSA");

This token looks promising - has some nice methods, but with "cryptic" arguments. What to do next?

3
  • 2
    Have you seen this guide? : Cryptographic Smart Card Driver Development Guide
    – user784540
    Sep 30, 2011 at 7:33
  • 2
    Could you explain more clearly what you want that code to do, and how it's failing? Nov 21, 2011 at 2:15
  • 2
    Has there been any development on this? I feel like you probably figured it out after more than a year and a half. I could be wrong, but if you did, post your answer and take this off the unanswered list. Dec 8, 2011 at 2:58

2 Answers 2

1

I think this is what you are looking for:

http://code.google.com/p/seek-for-android/wiki/BTPCSC

0

You have to implement SmartCardSession methods, also implement RSACryptoToken methods. With SmartCardSession methods you will be able to communicate with smart card, and with RSACryptoToken methods, you will be able to perform crypto operations. You have to read also about APDU protocol.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.