This project is deprecated, please use xipki/ipkcs11wrapper(preferred) or xipki/jpkcs11wrapper instead.
<dependency>
<groupId>org.xipki.iaik</groupId>
<artifactId>sunpkcs11-wrapper</artifactId>
<version>1.4.10</version>
</dependency>
To use pkcs11wrapper in JDK 17 or above, please add the following java option:
--add-exports=jdk.crypto.cryptoki/sun.security.pkcs11.wrapper=ALL-UNNAMED
example/data/pkcs11.properties
.mvn test
-PspeedTests
speed.threads
, e.g.
-Dspeed.threads=5
to use 5 threads.speed.duration
, e.g.
-Dspeed.duration=10s
for 10 seconds.*SecretKey
, please use the constructor ValuedSecretKey(long keyType)
instead, e.g. use new ValuedSecretKey(PKCS11Constants.CKK_AES)
for AES SecretKey.ECDSAPrivateKey
and ECDSAPublicKey
, please use ECPrivateKey
and ECPublicKey
instead.iaik.pkcs.pkcs11.objects.Object
is renamed to iaik.pkcs.pkcs11.objects.PKCS11Object
.Token.closeAllSession()
cannot be supported, since it is not supported in the underlying JNI (JDK's SunPKCS11 provider). Please manage your session by yourself. You can close a single session by Session.closeSession()
.Module.initialize()
once per native .so/.dll. Once Module.finalize(Object)
has been called, the module cannot be initialized anymore.