/usr/share/doc/python-pyhsm/examples/yhsm-sysinfo.py is in python-pyhsm 1.0.4l-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #!/usr/bin/env python
#
# Copyright (c) 2011 Yubico AB
# See the file COPYING for licence statement.
#
# Utility to show system information of a YubiHSM.
#
import sys
sys.path.append('Lib');
import pyhsm
device = "/dev/ttyACM0"
# simplified arguments parsing
d_argv = dict.fromkeys(sys.argv)
debug = d_argv.has_key('-v')
if d_argv.has_key('-h'):
sys.stderr.write("Syntax: %s [-v]\n" % (sys.argv[0]))
sys.exit(0)
res = 0
try:
s = pyhsm.base.YHSM(device=device, debug=debug)
print "Version : %s" % (s.info())
nonce = s.get_nonce()
print "Power-up count : %i" % (nonce.pu_count)
except pyhsm.exception.YHSM_Error, e:
print "ERROR: %s" % e
res = 1
sys.exit(res)
|