diff --git a/doc/usage.md b/doc/usage.md index 80c7d1e..6dd2eb9 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -30,7 +30,7 @@ PIN=648219 ## Initialization The first step is to initialize the HSM. To do so, use the `pico-hsm-tool.py` in `tools` folder: ``` -$ python3 pico-hsm-tool initialize --so-pin 3537363231383830 --pin 648219 +$ python3 pico-hsm-tool.py initialize --so-pin 3537363231383830 --pin 648219 ``` The PIN number is used to manage all private keys in the device. It supports three attemps. After the third PIN failure, it gets blocked. The PIN accepts from 6 to 16 characters. diff --git a/tools/pico-hsm-tool.py b/tools/pico-hsm-tool.py old mode 100755 new mode 100644 index 41df2b7..00b399c --- a/tools/pico-hsm-tool.py +++ b/tools/pico-hsm-tool.py @@ -24,17 +24,16 @@ try: from smartcard.CardType import AnyCardType from smartcard.CardRequest import CardRequest from smartcard.Exceptions import CardRequestTimeoutException -except: +except ModuleNotFoundError: print('ERROR: smarctard module not found! Install pyscard package.\nTry with `pip install pyscard`') sys.exit(-1) try: + from cvc.certificates import CVC from cvc.asn1 import ASN1 from cvc.oid import oid2scheme from cvc.utils import scheme_rsa - from cvc.certificates import CVC - -except: +except ModuleNotFoundError: print('ERROR: cvc module not found! Install pycvc package.\nTry with `pip install pycvc`') sys.exit(-1) @@ -44,7 +43,7 @@ try: from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305 from cryptography.hazmat.primitives import hashes -except: +except ModuleNotFoundError: print('ERROR: cryptography module not found! Install cryptography package.\nTry with `pip install cryptography`') sys.exit(-1)