background image

BlackBerry Java Development Environment  Version 4.6.0 Cryptographic Smart Card Driver Development Guide 

Last modified: 6 October 2008

Part number: 12802084

At the time of publication, this documentation is based on the BlackBerry Java Development Environment  Version 4.6.0.

Send us your comments on product documentation:

 

https://www.blackberry.com/DocsFeedback

.

©2008 Research In Motion Limited. All rights reserved. BlackBerry®, RIM®, Research In Motion®, SureType® and related trademarks, names, 
and logos are the property of Research In Motion Limited and are registered and/or used as trademarks in the U.S., Canada, and countries 
around the world.

Bluetooth is a trademark of Bluetooth SIG. Java is a trademark of Sun Microsystems, Inc. SafeNet is a trademark of SafeNet, Inc. Casira is a 
trademark of Cambridge Silicon Radio Ltd. RSA is a trademark of RSA Security. All other brands, product names, company names, trademarks 
and service marks are the properties of their respective owners.

The BlackBerry smartphone and other devices and/or associated software are protected by copyright, international treaties, and various 
patents, including one or more of the following U.S. patents: 6,278,442; 6,271,605; 6,219,694; 6,075,470; 6,073,318; D445,428; D433,460; 
D416,256. Other patents are registered or pending in the U.S. and in various countries around the world. Visit 

www.rim.com/patents

 for a list 

of RIM (as hereinafter defined) patents.

This documentation including all documentation incorporated by reference herein such as documentation provided or made available at 

www.blackberry.com/go/docs

 is provided or made accessible "AS IS" and "AS AVAILABLE" and without condition, endorsement, guarantee, 

representation, or warranty of any kind by Research In Motion Limited and its affiliated companies ("RIM") and RIM assumes no responsibility 
for any typographical, technical, or other inaccuracies, errors, or omissions  in this documentation. In order to protect RIM proprietary and 
confidential information and/or trade secrets, this documentation may describe some aspects of RIM technology in generalized terms. RIM 
reserves the right to periodically change information that is contained in this documentation; however, RIM makes no commitment to provide 
any such changes, updates, enhancements, or other additions to this documentation to you in a timely manner or at all.

This documentation might contain references to third-party sources of information, hardware or software, products or services including 
components and content such as content protected by copyright and/or third-party web sites (collectively the "Third Party Products and 
Services"). RIM does not control, and is not responsible for, any Third Party Products and Services including, without limitation the content, 
accuracy, copyright compliance, compatibility, performance, trustworthiness, legality, decency, links, or any other aspect of Third Party 
Products and Services. The inclusion of a reference to Third Party Products and Services in this documentation does not imply endorsement by 
RIM of the Third Party Products and Services or the third party in any way.

EXCEPT TO THE EXTENT SPECIFICALLY PROHIBITED BY APPLICABLE LAW IN YOUR JURISDICTION, ALL CONDITIONS, ENDORSEMENTS, 
GUARANTEES, REPRESENTATIONS, OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY 
CONDITIONS, ENDORSEMENTS, GUARANTEES, REPRESENTATIONS OR WARRANTIES OF DURABILITY, FITNESS FOR A PARTICULAR 
PURPOSE OR USE, MERCHANTABILITY, MERCHANTABLE QUALITY, NON-INFRINGEMENT, SATISFACTORY QUALITY, OR TITLE, OR 
ARISING FROM A STATUTE OR CUSTOM OR A COURSE OF DEALING OR USAGE OF TRADE, OR RELATED TO THE DOCUMENTATION OR 
ITS USE, OR PERFORMANCE OR NON-PERFORMANCE OF ANY SOFTWARE, HARDWARE, SERVICE, OR ANY THIRD PARTY PRODUCTS AND 
SERVICES REFERENCED HEREIN, ARE HEREBY EXCLUDED. YOU MAY ALSO HAVE OTHER RIGHTS THAT VARY BY STATE OR PROVINCE. 
SOME JURISDICTIONS MAY NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES AND CONDITIONS. TO THE EXTENT 
PERMITTED BY LAW, ANY IMPLIED WARRANTIES OR CONDITIONS RELATING TO THE DOCUMENTATION TO THE EXTENT THEY CANNOT 
BE EXCLUDED AS SET OUT ABOVE, BUT CAN BE LIMITED, ARE HEREBY LIMITED TO NINETY (90) DAYS FROM THE DATE YOU FIRST 
ACQUIRED THE DOCUMENTATION OR THE ITEM THAT IS THE SUBJECT OF THE CLAIM.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN YOUR JURISDICTION, IN NO EVENT SHALL RIM BE LIABLE FOR ANY TYPE 
OF DAMAGES RELATED TO THIS DOCUMENTATION OR ITS USE, OR PERFORMANCE OR NON-PERFORMANCE OF ANY SOFTWARE, 

Summary of Contents for JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE

Page 1: ...BlackBerry Java Development Environment Version 4 6 0 Cryptographic Smart Card Driver Development Guide...

Page 2: ...that is contained in this documentation however RIM makes no commitment to provide any such changes updates enhancements or other additions to this documentation to you in a timely manner or at all T...

Page 3: ...LITY ARISING FROM OR RELATED TO THE DOCUMENTATION Prior to subscribing for installing or using any Third Party Products and Services it is your responsibility to ensure that your airtime service provi...

Page 4: ......

Page 5: ...key file 8 2 Testing a cryptographic smart card driver 11 Set up the BlackBerry Device Simulator to test a cryptographic smart card driver 11 Set up a BlackBerry device to test a cryptographic smart c...

Page 6: ......

Page 7: ...ormation on S MIME The smart card API information included with BlackBerry JDE Version 4 2 or later contains some deprecated elements The deprecated elements provide backward compatibility for a crypt...

Page 8: ...he Application tab in the Project type field type Library 4 Select the Auto run on startup check box 5 In the Startup Tier field select the 7 Last 3rd party apps only option 6 Click OK Create a libMai...

Page 9: ...Berry Device Software Version 4 2 or later implement CryptoSmartCardSession getKeyStoreDataArrayImpl as follows RSACryptoToken token new MyRSACryptoToken RSACryptoSystem cryptoSystem new RSACryptoSyst...

Page 10: ...rsistable 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...

Page 11: ...PrivateKeyData 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 Ve...

Page 12: ...ESC 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...

Page 13: ...a private key file on the smart card on page 28 for more information Retrieve the location of the private key file on the smart card Create a method that returns the location of the private key file...

Page 14: ...10 Cryptographic Smart Card Driver Development Guide...

Page 15: ...Simulator to test a cryptographic smart card driver Set up a BlackBerry device to test a cryptographic smart card driver Test the cryptographic smart card driver Note You do not require the Casira Bl...

Page 16: ...evice Task Steps Make sure the cryptographic smart card driver is installed on a BlackBerry device 1 On the BlackBerry device click Options Security Options Smart Card 2 Ensure the cryptographic smart...

Page 17: ...13 2 Testing a cryptographic smart card driver...

Page 18: ...14 Cryptographic Smart Card Driver Development Guide...

Page 19: ...byte 0x71 byte 0x8e byte 0x64 byte 0x86 byte 0xd6 byte 0x01 byte 0x00 byte 0x81 byte 0x90 byte 0x00 private final static AnswerToReset _myATR new AnswerToReset MY_ATR private static final String LABEL...

Page 20: ...this smart card object to communicate with a physical smart card that has the given AnswerToReset The system invokes this method to ascertain which smart card implementation it should use to communica...

Page 21: ...The driver should not block the event thread for long periods of time param context Reserved for future use protected void displaySettingsImpl Object context Dialog alert DISPLAY_SETTINGS Retrieve the...

Page 22: ...o not hold open sessions when not using them they should be short lived As a security precaution only one open session is allowed to exist per SmartCardReader subsequent openSession requests will bloc...

Page 23: ...wed login attempts The method returns Integer MAX_VALUE if an infinite number of attempts are allowed protected int getMaxLoginAttemptsImpl throws SmartCardException return 5 Retrieve the remaining nu...

Page 24: ...A1Digest digest update uniqueCardData long idLong byteArrayToLong Arrays copy digest getDigest 0 8 Using friendly display name return new SmartCardID idLong ID_STRING getSmartCard Converts code array...

Page 25: ...00 maxBytes ResponseAPDU response new ResponseAPDU sendAPDU command response Check for response codes specific to your smart card if response checkStatusWords byte 0x90 byte 0x00 The appropriate respo...

Page 26: ...ata null ID_CERT privateKey null KeyStore SECURITY_LEVEL_HIGH certificate null null 0 stepProgressDialog 1 privateKey new RSAPrivateKey cryptoSystem new MyCryptoTokenData smartCardID SIGNING_PKI keySt...

Page 27: ...lication Protocol Data Unit ResponseAPDU response new ResponseAPDU Construct the command and set its information Create a CommandAPDU which your smart card will understand CommandAPDU signAPDU new Com...

Page 28: ...s an implmentation of an RSA cryptographic token The RIM Crypto API will use this object to perform a private key RSA operation This object should delegate the operation to the smart card final class...

Page 29: ...oSystem cryptoSystem CryptoTokenPrivateKeyData privateKeyData throws CryptoTokenException return privateKeyData instanceof MyCryptoTokenData Perform RSA decryption of unprocessed data p Notes To revea...

Page 30: ...sed If the RSA Crypto token requires the padding to be removed before signing this method will need to detect and remove the type of padding that is currently used The RSA Crypto token should only re...

Page 31: ...ardFactory getSmartCardSession smartCardID if smartCardSession instanceof MyCryptoSmartCardSession MyCryptoSmartCardSession mySmartCardSession MyCryptoSmartCardSession smartCardSession We must provide...

Page 32: ...api smartcard import net rim device api util This class stores the location of the private key file on the smart card final class MyCryptoTokenData implements CryptoTokenPrivateKeyData Persistable Sma...

Page 33: ...ile containing the private key file return ID of the smart card public SmartCardID getSmartCardID return _id Retrieve the location of the private key file on the smart card return Location of the priv...

Page 34: ...30 Cryptographic Smart Card Driver Development Guide...

Page 35: ......

Page 36: ...2007 Research In Motion Limited Published in Canada...

Reviews: