Files
gnuk/tool/gnuk_get_random.py
2019-02-22 19:53:52 +09:00

16 lines
381 B
Python
Executable File

#! /usr/bin/python3
from gnuk_token import get_gnuk_device, gnuk_token
from binascii import hexlify
import sys
if __name__ == '__main__':
gnuk = get_gnuk_device()
gnuk.cmd_select_openpgp()
looping = (len(sys.argv) > 1)
while True:
challenge = gnuk.cmd_get_challenge().tostring()
print(hexlify(challenge))
if not looping:
break