The Bouncy Castle Cryptography Package

Team-Fly

In the J2SE world, Sun provides support for cryptography through the Java Cryptography Architecture (JCA) and the Java Cryptography Extension (JCE). The problem, of course, is that the JCA and JCE are too heavy for the MIDP platform. So far, Sun is not providing any solutions for cryptography in J2ME. At JavaOne in 1999, they demonstrated what appeared to be MIDP plus SSL support, but no product has come from it yet. You can read more about it in a few conference session slides available here: http://playground.sun.com/~vgupta/KSSL/.

It is probably only a matter of time before someone integrates SSL with a MIDP implementation. After all, the generic connection framework means that an implementation could support https connections transparently. Although MIDP requires only HTTP support, implementations are free to support other types of connections.

In the meantime, your best bet is the Bouncy Castle cryptography package, an open source effort based in Australia. It's a wonderful piece of work, featuring a clean API and a formidable toolbox of cryptographic algorithms. There are several other open source cryptography packages around the world, but Bouncy Castle specifically offers a lightweight J2ME distribution of their software. To download the package, go to http://www.bouncycastle.org/, follow the link for latest releases, and choose the J2ME release.

Download the zip file into the location of your choice. If you're using the J2MEWTK, follow these instructions to put the Bouncy Castle classes in your project:

  1. Copy the java and org directories from the src directory into the src directory of your J2MEWTK project.

  2. Remove the org/bouncycastle/crypto/examples directory and the org/bouncycastle/crypto/test directory.

Now your J2MEWTK project should compile without errors. You can go ahead and write MIDlets that use the Bouncy Castle package.


Team-Fly


Wireless Java. Developing with J2ME
ColdFusion MX Professional Projects
ISBN: 1590590775
EAN: 2147483647
Year: 2000
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net