Skip navigation links
JCProv
Jcprov provides a Java interface to SafeNet Inc.'s implementation of PKCS#11 V2.11, including some proprietary extensions.

See: Description

Packages 
Package Description
com.safenetinc.jcprov
Provides access to the API functions, and general structure/class definitions.
com.safenetinc.jcprov.constants
Provides PKCS#11 related constant definitions.
com.safenetinc.jcprov.params
Provides parameter structure/class definitions used by some mechanisms.
com.safenetinc.jcprov.sample
Provides sample code to demonstrate usage of Jcprov.
Jcprov provides a Java interface to SafeNet Inc.'s implementation of PKCS#11 V2.11, including some proprietary extensions.

The Jcprov API tries to stay as true as possible to PKCS#11 'C' API, whilst incorporating SafeNet Inc. extensions. As such, some functions may not be as Java'ised as possible (e.g. functions which take a byte[] and a length to indicate the size of the byte[] could really just take a byte[] because the length can be obtained).

Some PKCS#11 (or Cryptoki) functions return a long value via an output argument (e.g. using Cryptoki.C_Encrypt to determine the required size of the output buffer). Since this is not possible in Java, in these cases the LongRef class is used to represent a reference to a long.

The main class which provides access to the Cryptoki API is Cryptoki. As the PKCS#11 API is 'C' based, all functions return an error code. To stay true to the API, the class also returns error codes - instead of throwing exceptions. In rare cases, a RuntimeException may be thrown by functions from the class (e.g. if a constant object, such as CKK.DES is passed into Cryptoki.C_GetAttributeValue via the attribute template, then a java.lang.UnsupportedOperationException object is thrown, to indicate that modification of a constant is not allowed).

To put more of a Java spin on it, a supporting class CryptokiEx has been supplied. The class provides the same set of functions as its counterpart - except as well as returning an error code, if an error occurs a CKR_Exception object is thrown. This allows the programmer to use normal Java exception programming techniques.

JCProv

Copyright (c) SafeNet, Inc. 2012-2016. All rights reserved.