Last active
February 10, 2018 16:30
-
-
Save trebortech/277a00b8d8609c61742307db38bbee76 to your computer and use it in GitHub Desktop.
SetPinRetries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Core lib imports | |
from binascii import a2b_hex | |
# Yubico lib imports | |
from ykman import driver_ccid as CCID | |
from ykman import piv as PIV | |
objCCIDDevices = CCID.open_devices() | |
driverCCID = objCCIDDevices.next() | |
# Create connection to PIV modules | |
controllerPIV = PIV.PivController(driverCCID) | |
print "Serial Number: {0}".format(driverCCID.serial) | |
# Default YubiKey values | |
defaultPIN = '123456' | |
defaultPUK = '12345678' | |
defaultMGT = '010203040506070801020304050607080102030405060708' | |
byteMGT = a2b_hex(defaultMGT) | |
# Verify and authenticate to device | |
controllerPIV.verify(defaultPIN) | |
controllerPIV.authenticate(byteMGT) | |
# The PIN and PUK will be set to default values | |
pintries = 6 | |
puktries = 6 | |
controllerPIV.set_pin_retries(pintries, puktries) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment