-
Notifications
You must be signed in to change notification settings - Fork 13
use xipki/pkcs11wrapper instead mikma/pkcs11wrapper #1
Comments
Hi Armando, please adapt your code as follows:
Best regards |
You may find example on the usage of this Pkcs11wrapper under https://github.com/xipki/pkcs11wrapper/tree/sunpkcs11/examples. |
ok, thanks. I fixed my code and now work fine :) I have only a issue: i implemented a "reload pkcs11 config" feature that reload module and slot info from xml at runtime and try to unload old objects (tokens and modules) then generate new objects. With this scenario to initialize modules and get slot list i use
to finalize modules i use:
but when i recall for second time function to initialize modules, getSlotList method return an empty array []. To work fine i need to restart application. Have you any idea ? |
Hi Armando, please finalize the module only if you are sure that it will not be used anymore. Once you have finalized it, you cannot re-initialize it again in one JVM. This is the restriction of Sun's PKCS#11 wrapper. For details of this restriction please refer to https://github.com/openjdk/jdk/blob/523ef3b3720283cd1696ce9fd0a977c1f41b2965/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java#L151. BR Lijun |
ok, i know. Thanks |
I extended the Module.finalize(Object) method to make the Module re-initializable after the finalization. Now one should be able to re-initialize the module. Please try again using the following dependency in your maven project:
|
YEAH, now work also module re-init after finalize |
unfortunately, the access of private field is deprecated in JDK 13 and will be removed in the later versions. So I remove the code block in |
ok, i know. But with your latest feature now it's possible, so this fix will be definitive or it's possible in future that this feature doesn't work anymore ? |
For consistency, I do not want to have two versions with different behaviors. So the aforementioned have been removed from the released version 1.4.5. |
BTW, the rename of package |
Hi xipki,
i trying to use your wrapper instead mikma but i saw that some objects are missing:
iaik.pkcs.pkcs11.objects.AESSecretKey
iaik.pkcs.pkcs11.objects.ECDSAPrivateKey
iaik.pkcs.pkcs11.objects.ECDSAPublicKey
iaik.pkcs.pkcs11.objects.Object
iaik.pkcs.pkcs11.parameters.Parameters
iaik.pkcs.pkcs11.wrapper.PKCS11Constants
iaik.pkcs.pkcs11.wrapper.Functions
and some methods:
Token.closeAllSessions()
Session.destroyObject(PKCS11Object)
have you planning a roadmap for porting ?
regards
Armando
The text was updated successfully, but these errors were encountered: