def extend_password_with_yubikey(password, options, YubiKey=None): if YubiKey is None: from ykpers import YubiKey yk = YubiKey.open_first_key() response = yk.hmac_challenge_response( signing_uuid.bytes, slot=options['yubikey-slot']) return hexlify(response) + ':' + password
def extend_password_with_yubikey(password, options, YubiKey=None): if YubiKey is None: from ykpers import YubiKey yk = YubiKey.open_first_key() response = yk.hmac_challenge_response(signing_uuid.bytes, slot=options['yubikey-slot']) return hexlify(response) + ':' + password
# Copyright (c) Aaron Gallagher <*****@*****.**> # See COPYING for details. from ykpers import YubiKey yk = YubiKey.open_first_key() print 'yubikey {0.versionMajor}.{0.versionMinor}'.format(yk.get_status()) print 'slot 1:', yk.hmac_challenge_response('hi').encode('hex') print 'slot 2:', yk.hmac_challenge_response('hi', slot=2).encode('hex')