This zip should include at least these files:

        readme.txt        - this file
        auto.pl           - the perl script that generates the java wrapper
        stripcode.pl      - a supporting script for auto.pl
        CryptLibTest.java - an example of password-based enveloping from java
        Demo.java         - another example with public key encryption & signing

auto.pl takes two input files from the cryptlib source, 

        cryptapi.c and cryptlib.h, 

and generates four output files, 

        cljni.c, cljni.h, CryptLib.java, CryptLibConstants.java

and a temp file which may safely be deleted (add a line to the end of the perl script if you want)

        stripped.c

Be sure to add cljni.* to your build and recompile cl32.dll before attempting to use it via JNI.

All the cryptlib functions from cryptapi.c plus cryptInit() and cryptEnd() have been made members of the com.cryptlib.CryptLib class.  All the constants defined in cryptlib.h (except those in #if blocks) are public final ints in the com.cryptlib.CryptLibConstants interface.  It is recommended that classes that call CryptLib methods implement the interface so that the constants can be used without a prefix.  They're long enough already!

CryptLib expects to have cl32.dll (recompiled with the auto-generated jni stuff included) someplace it can find it.

There is an example file CryptLibTest.java packaged with the scripts that follows the simple password-based enveloping from page 35 of the cryptlib manual.  It ought to give the flavor of the class and how to use it.

Here's a list of cryptlib datatypes and their corresponding java types:

        C_IN CRYPT_BLAH = int
        C_IN char C_PTR = String
        C_IN void C_PTR = byte[]
        C_IN int = int
        C_INOUT void C_PTR = byte[][]
        C_OUT CRYPT_QUERY_INFO C_PTR = String[1] algoName, int[4] sizes
        C_OUT CRYPT_BLAH C_PTR = int[1]
        C_OUT int C_PTR= int[1]
        C_OUT void C_PTR = byte[]

where BLAH should be read as a wildcard excluding QUERY_INFO.

They're all straightforward conversions except for the CRYPT_QUERY_INFO type.  Instead of returning a java class with five members, it returns the members separately.  The sizes[] array contains the following sizes:

        sizes[0] = blockSize
        sizes[1] = minKeySize
        sizes[2] = keySize
        sizes[3] = maxKeySize

Also note that since there's no such thing as pointers in Java, when a cryptlib function requires a pointer, com.cryptlib.CryptLib gets an array with one or more elements.  So one'll typically have code like what is seen in CryptLibTest.java:

        int[] cryptEnvelope = new int[1];
        ...
        cl.cryptCreateEnvelope( cryptEnvelope, CRYPT_UNUSED, CRYPT_FORMAT_CRYPTLIB );
       	cl.cryptSetAttributeString( cryptEnvelope[0], CRYPT_ENVINFO_PASSWORD, "password".getBytes("UTF8"), 8 ); 

where cryptlib handles will usually be declared as one-element int arrays.  The array itself is passed into the cryptCreateBlah() function while the zeroth element of the array is used in all the calls that follow.