Using custom PKCS11 provider with jarsigner

老子叫甜甜 提交于 2020-01-14 14:13:41

问题


I wrote a custom PKCS11 provider and now i want to user it via jarsigner.

My command :

jarsigner -verbose -keystore NONE -storetype PKCS11 -providerClass my.provider.class jar_to_sign_on.jar "key_name"

And i get the following error :

jarsigner error: java.lang.ClassNotFoundException: my.provider.class

This is because jarsinger can't find my provider .jar implementation.

When i put mt .jar in ...\Java\jdk1.8.0_31\jre\lib\ext it works perfectly.

My question is : There is a way to dynamically set my provider .jar ? (Like -providerPath in keytool)


回答1:


jarsigner has -J option that allows to pass its value right to the backing java process. The problem is that it doesn't allow spaces, so you need two such options to pass a classpath. Something like this should work:

jarsigner ... -J-cp -Jmylib.jar



来源:https://stackoverflow.com/questions/38450168/using-custom-pkcs11-provider-with-jarsigner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!