[英]Unblock PIN of SmartCard via Java (SunPKCS11)
i try to unblock or change a pin on smartcard tokens via java.我尝试通过 java 解锁或更改智能卡令牌上的引脚。 Writing and reading smartcard-certificates via SunPKCS11-Wrapper is no big deal but i cannot see any C_setPIN or C_initPIN-methods in the PKCS11-wrapper-class.
通过 SunPKCS11-Wrapper 写入和读取智能卡证书没什么大不了的,但我在 PKCS11-wrapper-class 中看不到任何 C_setPIN 或 C_initPIN 方法。
So is there a way to unblock a smartcards pin with the SunPKCS11-Wrapper?那么有没有办法使用 SunPKCS11-Wrapper 解锁智能卡引脚?
The PKCS#11 provider of Sun is not really suitable for that. Sun 的 PKCS#11 提供程序并不适合这种情况。 But it has been implemented on top of the open source wrapper from IAIK, which may contain what you are looking for, see the link to Session.setPIN() .
但它已在 IAIK 的开源包装器之上实现,其中可能包含您正在寻找的内容,请参阅Session.setPIN()链接。 Note that linking directly to the
sun.*
package is heavily frowned upon, although the Session
class is pretty likely to be hidden in there somewhere.请注意,直接链接到
sun.*
包是非常不受欢迎的,尽管Session
类很可能隐藏在那里的某个地方。
PIN unblock with IAIK PKCS11 wrapper:使用 IAIK PKCS11 包装器解锁 PIN:
Session session = token.openSession(Token.SessionType.SERIAL_SESSION, Token.SessionReadWriteBehavior.RW_SESSION, null, null);
session.login(Session.UserType.SO, puk.toCharArray());
session.initPIN(newPin.toCharArray());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.