This JNI implementation exposes a large subset of P6R's Secure KMIP Client SDK which is implemented in C++. This JNI implementation exposes the most commonly used and asked for KMIP features. The underlying SKC KMIP implementation is full featured supporting KMIP protocol versions: 1.0, 1.1, 1.2, 1.3, and 1.4. If there is something missing from the JNI KMIP API that you need please let us know and we will be happy to add it.
This KMIP JNI implementation is easy to use and follows standard Java practices (e.g., using Exceptions instead of return error codes). We have tested this JNI implementation with a set of JUNIT tests that we have included for your use and as examples of how to use this KMIP API. We got so used to this Java API we forgot that the underlying KMIP implementation was actually in C++.
Please refer to the included javadoc for each of these classes.
First the normal SKC library setup is required. To run the SKC library you must first create an SKC example. This places all of the P6R KMIP code into one directory which you can use for all your testing. All P6R KMIP code runs out of one, writable, directory. Once that is created copy the file libp6javakmip.so (for linux) and p6javakmip.dll into this one "run" directory. This file is the bridge between the p6kmipclient.jar Java file and the SKC library. As defined in the Java Classpath section below the full path of this run directory must also appear in the Java Classpath so that Java can find this file. Meanwhile the p6kmipclient.jar file can be placed with the rest of your java application in any directory you choose.
KMIP requires the use of both server and client side TLS credentials. Instead of adding these details to the JNI KMIP API we have taken the standard Java approach to add these to a keystore via a command line tool. Our library uses the P6R keystore (which is based on a real databases either SQLite or Postgres) and our command line tool p6kmiptool to initialize that keystore. The p6kmiptool (separate documentation in this SDK) also provides a rich feature set to access a KMIP server, which can be done by hand or via scripts. So for each KMIP server to be accessed via the JNI API its TLS credentials must first be configured by the p6kmiptool. P6R's keystore and p6kmiptool can handle any number of KMIP servers there is no limit.
So for each KMIP server you wish to access via the JNI API first add its definition to the p6kmiptool.conf file and use the p6kmiptool to install those credentials into the generated keystore. At that point you can use the p6kmiptool to make sure your TLS connection is working properly by performing a "p6kmiptool -serverinfo -server <server IP address or domain name>" command.
In addition to the TLS credentials the p6kmiptool.conf file allows other KMIP client behavior to be adjusted. For example, you can turn on the KMIP message logging when needed to see the KMIP command / response messages that match your calls to JNI API functions and to help resolve support issues. There are many different KMIP settings that can be made such as whether to use KMIP TTLV, XML, or JSON message encoding for example. In addition, there is also a configuration setting to modify TLS session behavior. All of these parameters are documented in the standard SKC documentation for the C++ KMIP SDK.
P6R's native KMIP client contains several ".dll" files on Windows and ".so" files on Linux that all run out of a single "run" directory. This directory includes the p6javakmip.dll (or libp6javakmip.so) JNI implementation. For the Java code in the p6kmipclient.jar file to find and load the JNI implementation the single P6R "run" directory must be specified on the command line with "-Djava.library.path=<full path to run directory>" (see below). This is set by the calling Java application and not by the JNI implementation.
All the JUNIT test cases can be run on Linux (we tested on Centos 6) via the command line as follows:
1) Rob Gordon, "Essential JNI: Java Native Interface", Prentice Hall PTR, 1998, ISBN 0-13-679895-0.
2) Java Programming Tutorial, Java Native Interface (JNI), http://www.ntu.edu.sg/home/ehchua/programming/java/JavaNativeInterface.html.
3) S.Stricker, Java programming with JNI, http://www.ibm.com/developerworks/java/tutorials/j-jni/j-jni.html.