public class DemoPkcs11All extends java.lang.Object implements CMSKeyStoreConstants
For running this demo the following packages are required:
iaik_cms.jar
iaik_jce(_full).jar (IAIK-JCE Core Crypto Library).
iaikPkcs11Provider.jar (IAIK PKCS#11 Provider).
iaikPkcs11Wrapper.jar (IAIK PKCS#11 Wrapper).
pkcs11wrapper.dll for Windows, libpkcs11wrapper.so for Unix); contained in the IAIK PKCS#11 Wrapper library.
iaik_eccelerate.jar (IAIK ECC Library, if you want to use Elliptic Curve Cryptography).
iaik_cms.jar, iaik_cms_demo.jar, iaik_jce(full).jar,
iaikPkcs11Wrapper.jar and iaikPkcs11Provider.jar (and
iaik_eccelerate.jar, mail.jar, activation.jar) have
to be put into the classpath, the shared library (pkcs11wrapper.dll or
libpkcs11wrapper.so) has to be in your system library search path or in your VM
library path, e.g. (on Windows, assuming that all jar files are located in a lib sub-directory
and the dll is in a lib/win64 sub-directory):
java -Djava.library.path=lib/win64
-cp lib/iaik_jce.jar;lib/iaikPkcs11Wrapper.jar;lib/iaikPkcs11Provider.jar;lib/iaik_cms.jar;lib/iaik_cms_demo.jar;lib/mail.jar;lib/activation.jar
demo.DemoPkcs11All <pkcs11Module>.dll
CA_DSA, CA_RSA, CA_RSAPSS, DSA_1024, DSA_2048, DSA_3072, ESDH_2048_1, ESDH_2048_2, KS_DIRECTORY, KS_FILENAME, KS_PASSWORD, RSA_2048_CRYPT_1, RSA_2048_CRYPT_2, RSA_2048_CRYPT_3, RSA_2048_SIGN_1, RSA_2048_SIGN_2, RSA_2048_SIGN_3, RSAPSS_2048_SHA1_SIGN, RSAPSS_2048_SHA256_SIGN, RSAPSS_2048_SHA384_SIGN, RSAPSS_2048_SHA512_SIGN, SSDH_2048_1, SSDH_2048_2, TSP_SERVER| Constructor and Description |
|---|
DemoPkcs11All() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args)
Performs all tests.
|
void |
start(java.lang.String moduleName,
char[] userPin)
Start all tests.
|
public DemoPkcs11All()
public void start(java.lang.String moduleName, char[] userPin) throws java.lang.Exception
moduleName - the name of the PKCS#11 module to be useduserPin - the user-pin (password) for the TokenKeyStore
(may be null to pou-up a dialog asking for the pin)java.lang.Exceptionpublic static void main(java.lang.String[] args) throws java.io.IOException
args - the PKCS#11 module namejava.io.IOException