4

i try to unblock or change a pin on smartcard tokens via 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.

So is there a way to unblock a smartcards pin with the SunPKCS11-Wrapper?

Dano
  • 239
  • 3
  • 10

2 Answers2

1

The PKCS#11 provider of Sun is not really suitable for that. 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(). 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.

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
1

PIN unblock with IAIK PKCS11 wrapper:

  1. Login to the "security officer session" with the PUK code
    Session session = token.openSession(Token.SessionType.SERIAL_SESSION, Token.SessionReadWriteBehavior.RW_SESSION, null, null);
    session.login(Session.UserType.SO, puk.toCharArray());
  1. Initialization of the new PIN code
    session.initPIN(newPin.toCharArray());
Stephan Hogenboom
  • 1,543
  • 2
  • 17
  • 29
Peter
  • 11
  • 1