Skip to content

Commit

Permalink
test_init: test initToken()
Browse files Browse the repository at this point in the history
  • Loading branch information
LudovicRousseau committed Apr 11, 2018
1 parent 97b3953 commit 206ffa5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,16 @@ def test_setPin(self):
# revert to old PIN
self.session.setPin("4321", "1234")
self.session.logout()

def test_initToken(self):
self.pkcs11.closeAllSessions(self.slot)

# use admin PIN
self.pkcs11.initToken(self.slot, "123456", "my label")
self.session = self.pkcs11.openSession(self.slot,
PyKCS11.CKF_SERIAL_SESSION |
PyKCS11.CKF_RW_SESSION)
self.session.login("123456", user_type=PyKCS11.CKU_SO)
# set user PIN
self.session.initPin("1234")
self.session.logout()

0 comments on commit 206ffa5

Please sign in to comment.