Java-Powered iButton FAQ
This document is intended to answer the most common questions developers ask about the Dallas Semiconductor's Developer's Kit for our Java-powered Crypto iButtons (a.k.a.: iB-IDE). If you have a question which is not answered here, please contact us at jibsupport@dalsemi.com.
Questions from Developers
Dallas Semiconductor Support Team Answers
Answer: The iB-IDE is a complete replacement and enhancement of the previous JiBKit releases. All of the latest drivers and examples are contained in the distribution of the iB-IDE.
Answer: The Java-powered Crypto iButton is a secure Java Virtual Machine encased in a stainless-steel circular container only 16mm wide. It is Java-powered and designed according to Sun's Java Card 2.0 specification. Because it has more RAM than other Java Card-based products, your programs can do more, and since it relies on battery-backed static RAM to store its applets, it can be programmed over and over again as needs change. Perhaps best of all, the iButton's small size means it can be integrated into all sorts of personal accessories for both safe keeping and convenience of use.
This iButton has a super-fast, 1024-bit modular math coprocessor for cryptographic operations. Having such a coprocessor makes the Java-powered Crypto iButton ideal as a general-purpose security device, fully capable of performing secure transactions over the internet.
Coming soon: Java-Powered iButton version 2.0 with 134k of RAM.
Answer: This version was developed for and tested on the Java 2 platform (JDK 1.2). This is a requirement to install and run iB-IDE, but the underlying iButton code needed to simply run iButton applications will work on JDK 1.1.x.
Note: the JDK 1.2 and 1.2.1 distributions are both fully tested to work correctly with iB-IDE. However, JDK 1.2.2 introduces some incompatibilities making it currently unusable.
Answer: The iB-IDE supports Windows 95TM, Windows NTTM, and SolarisTM versions 2.5.1 or greater.
iB-IDE requires JDK 1.2 to run. Since an official version of the Java 2 platform has not been released for the Linux platform, we have not made available an iB-IDE installation for Linux. However, there are several seemingly stable JDK 1.2 betas available from various sources, so we will release an installation for the Linux platform soon.
Answer: Try passing a command line parameter to the application that you are running. The command line parameter is the communications port name on your machine. Example: "java BusinessCardDisplay COM1"
Answer: In order to have "permission" from Windows NT to install drivers, you must be using an Administrator account when you install iB-IDE. Also, please note that in order for the NT drivers to work properly, you must also have Service Pack 2 or greater installed on your machine.
Note: These drivers are only needed if you are using the DS1410E parallel port adapter. They should not be needed for serial port communication, since serial communication can be achieved using pure Java.
Answer: What you see are debug and test statements sent to the console screen used during development. This, in itself, is not a cause for worry. If your applet still finds the iButton, then these messages may be ignored. If not, first make sure that there are no other applications running that may be using this port. If all else fails, move your Blue Dot adapter to another port.
Answer: The most likely cause is that Java cannot find a native library it needs in order to continue executing. If you are on Windows 95 or NT, make sure that both the "iButtonLegacy.dll" and "win32com.dll" are in the "[jdk1.2]\jre\bin" directory. If you are running Unix, then make sure the appropriate libraries can be found in the directory pointed to by the environment variable LD_LIBRARY_PATH.
This problem is also seen while using early betas of JDK 1.2. We currently recommend using the release version of JDK 1.2.
You might also see this sort of problem if you are running a vendor's VM other than the one provided by Sun. While several other vendors VM's have been shown to work well with these libraries, you should check with your vendor to find out whether their VM's conform to regular native Java standards, including where the appropriate libraries should reside.
Answer: You can order directly from our Information Security Store or contact Brian Kraman via e-mail at brian.kraman@dalsemi.com for purchasing information.
Answer: A return code of 0x6681 indicates a security problem while attempting to perform a command function, such as running an applet. All iButtons for Java have the potential to be locked using password protection. The rings from JavaOne 1998 use the PIN "1!J1".
Answer: A return code of 0x6903 is very similar to the above code of 0x6681, except that this code occurs as a result of attempting to load an applet. It also indicates that the master password supplied is incorrect. The only password used on Java Powered iButtons supplied at Java One 1998 is "1!J1".
Answer: A return code of 0x8453 is caused by selecting an applet that does not exist on the Java Ring. This almost always occurs when a developer mistakenly believes an applet has already been loaded.
Answer: You probably have environment size problems. You can change this value in Windows 95 by pulling up properties on the DOS shell you are using. Under the Memory tab, change the Initial Environment Size to a larger value. Apply the changes, and try again.
A similar error, "NoClassDefFoundError" may occur on the Windows 95 platforms for unknown reasons, and may sometimes be corrected by either (A) using the syntax "java -classpath %classpath% <myApplet>", or (B) by changing the order of required jar files in the classpath so that the jar file used by the application for itself is last.
Answer: There is a bug in the Java One '98 release of the iButton for Java which prevents the array index parameter to "sendBytesLong()" from completing successfully. This can be worked around by sending arrays which are larger than 255 bytes in pieces. By iteratively sending smaller packets, you can successfully load an array which is larger than 255 bytes. (The code generated by iB-IDE will automatically handle this for you.) This has been fixed in the 1.0 release of the Java-Powered iButton.
Answer: iB-IDE version 1.01 does include these classes in the online help under OpenCard Reference.
iB-IDE version 1.0 did not have this documentation online. These classes are a product of OpenCard consortium and the latest documentation can always be downloaded from the associated web site.
Answer: For information on the Java Card 2.0 specification refer to http://www.javasoft.com/products/javacard/index.html.
For the latest in OpenCard technology, visit http://www.opencard.org.
Check http://www.ibutton.com/iB-IDE for updated documentation on the iB-IDE.
Answer: The "javax.comm" package changed slightly when Sun promoted the code from EA to Beta status. In doing so, two method names have been changed: openPort() & closePort(). The new names for these methods is simply open() & close(). The latest version is included with the installation for iB-IDE.
The latest and most current version of our developer's is iB-IDE version 1.0. We strongly encourage all our developers to make the transition to this version if they are currently working with older versions.
Answer: The version 0 iButtonsa.k.a. 1998 JavaOne iButtons(Java iButton Firmware Version 0.03.0003) have no modular exponentiation capabilities. This ring is therefore not export controlled. It does have a SHA-1 hash class (javacardx.crypto.Sha1MessageDigest), a random number generator (javacardx.crypto.Random), and an onboard, real-time clock (COM.dalsei.Util.getClock()).
The 1.0 iButtons (Java iButton Firmware Version 1.00.0004) have a modular exponentiation function in addition to the version 0 iButton functions. This new function can be found in the com.dalsemi.system.Coprocessor class. This allows any modular exponentiation based cryptography schemes (RSA, DSA, etc.) to be implemented on the iButton. (See the RSASign example project in iB-IDE). Note: the Clock functionality was moved into com.dalsemi.system.Clock.getClock().
The 1.11 iButtons (iButton with Java - Firmware Version 1.11.0006) also have the javacardx.crypto package fully implemented (providing classes for RSA, DES, etc.). See the javacardx.crypto specification for the available functions.
Coming soon: The 2.0 iButtons that have 134k RAM in addition to the cryptographic abilities of the 1.0 and 1.11.
Answer: Both error codes indicate that you have compiled for the wrong version of iButton.
To remedy, insert the target iButton into your Blue Dot adapter and go into APDUSender under the Windows menu. Click on GetFirmwareVersion, the last icon on the right in the toolbar. The bottom right TextArea will then display the firmware version of the iButton currently selected in the Available iButtons pull-down list. (Make sure "Emulated iButton" is not the currently selected iButton).
Go to the online help under iButton Information -> iButton Applet Database (*.jibdb) Files to see what iButton Database you should use for your particular iButton.
Next, go into Compile -> Options, and make sure that iButton database file appears in the appropriate TextField at the bottom left of your screen. You should also update the iButton classes TextField. This info was left out of the online help, but if you are using javaone.jibdb, you should use iButton32.jar; if you are using jib33.jibdb, you use iButton33.jar, etc. The needed jar and jibdb files are contained in the iB-IDE/classes directory.
The next time you choose to Rebuild all, the jib file will be correctly produced for your iButton version.
Answer: If you are using the iB-IDE native drivers for communication to the iButton (which is the default), HotSpot will not work. From the HotSpot FAQ: "Native methods used with the Java HotSpot Performance Engine must conform to the Java Native Interface (JNI) specification. The Java HotSpot Performance Engine does not and will not support native method conventions older than the JNI specification."
The iB-IDE native drivers conform to the older stubs interface and will therefore not work with HotSpot. If you have HotSpot installed in your system, you need to either uninstall it, or edit the iB-IDE_1_01.bat (or .sh) file and add the "-classic" switch to the call to java. (Note: Windows users must also do the same update to the iB-IDE_1_01.ini file.)
However, you can choose instead to use javax.comm as your primary communication layer. To do so, edit the [jdk1.2]\jre\lib\opencard.properties file. This file should have all of the ports installed in your system enumerated on separate lines. All of the lines should be commented out with a '#' except for the port you are using. Find the line you are using and remove the embedded string "_LEGACY" from the line. You should now be able to use HotSpot with iB-IDE.
Answer: This is caused by [jdk1.2]\bin not being in your PATH environment variable. Add this to your PATH (making sure it is the first Java VM bin directory in your PATH). Windows systems may need to reboot.
You can also go into Compile -> Options and put the full path to javac.
Answer: Unix users can choose to specify the path to the desired VM if it doesn't appear in the available list. Java InstallShield will search the PATH for available VM's, so adding the desired VM bin directory to the PATH (as the first Java VM bin directory) will make that VM appear as available.
On Windows systems, Java InstallShield currently searches the registry for available VM's. These are often missing or altered so that a valid VM might not appear in the available list. Make sure these following registry entries exist. If they do not, use regedit to add them and try running setup again.
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\
JavaDevelopment Kit
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\
JavaDevelopment Kit\1.2
The first key should have one string value (other than 'Default') called "CurrentVersion" with a value of "1.2". The second key should have 2 string values. The first is named "JavaHome" with the value being the full path to your JDK installation directory. The second should be named "MicroVersion" and have a value of "0" if using the original JDK 1.2, or "1" if using 1.2.1. (Note: JDK 1.2.2 should currently not be used with iB-IDE. See supported JDK's for more information.)
This solves 98% of problems Windows users have with Java InstallShield. If this does not solve your problem, email jibsupport@dalsemi.com for further instructions.
Answer: iB-IDE's online help system is built around the JavaHelp API. There are several JavaHelp documented bugs pertaining to harmless exceptions being thrown when using the API. If the help system is responding correctly despite the numerous exceptions being thrown, you can safely ignore the exceptions. You can always clear the exceptions from your display by right clicking in the Message window and choosing to clear messages.
Answer: iB-IDE's online help system has several tutorials that walk you through step-by-step writing your first iButton project. The tutorials are located under Project Creation in the online help and are called Host and Applet Tutorial and Applet and APDUSender Tutorial.
Answer: This error is caused by running iB-IDE under JDK 1.2.2. This release introduces several incompatibilities making this version currently unusable with iB-IDE. See Supported JDK's to see which versions are supported.