所以我编写了一个程序,可以使用 USB token 对 pdf 进行签名,一切正常,我尝试使用同一公司(同一提供商)但样式不同(无指纹)的另一个 token 进行签名,我什至无法登录窗口显示。 这是我得到的错误:
SEVERE: null
java.io.IOException: load failed
at sun.security.pkcs11.P11KeyStore.engineLoad(P11KeyStore.java:763)
at java.security.KeyStore.load(KeyStore.java:1445)
Caused by: javax.security.auth.login.LoginException: no password provided, and no callback handler available for retrieving password
at sun.security.pkcs11.SunPKCS11.login(SunPKCS11.java:1184)
at sun.security.pkcs11.P11KeyStore.login(P11KeyStore.java:849)
at sun.security.pkcs11.P11KeyStore.engineLoad(P11KeyStore.java:751)
... 40 more
最佳答案
String pass="";
KeyStore.PasswordProtection pp = new keyStore.PasswordProtection(pass.toCharArray());
ks.load(null , pp.getPassword() );
解决了我的问题
关于java - itext- 无法使用另一个 USB token 签署 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40297492/