Added error message if package is missing.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -19,14 +19,24 @@
|
|||||||
*/
|
*/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from smartcard.CardType import AnyCardType
|
import sys
|
||||||
from smartcard.CardRequest import CardRequest
|
try:
|
||||||
from smartcard.Exceptions import CardRequestTimeoutException
|
from smartcard.CardType import AnyCardType
|
||||||
from cvc.certificates import CVC
|
from smartcard.CardRequest import CardRequest
|
||||||
from cvc.asn1 import ASN1
|
from smartcard.Exceptions import CardRequestTimeoutException
|
||||||
from cvc.oid import oid2scheme
|
from cvc.certificates import CVC
|
||||||
from cvc.utils import scheme_rsa
|
except:
|
||||||
from cryptography.hazmat.primitives.asymmetric import ec
|
print('ERROR: smarctard module not found! Install pyscard package.\nTry with `pip install pyscard`')
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
|
try:
|
||||||
|
from cvc.asn1 import ASN1
|
||||||
|
from cvc.oid import oid2scheme
|
||||||
|
from cvc.utils import scheme_rsa
|
||||||
|
from cryptography.hazmat.primitives.asymmetric import ec
|
||||||
|
except:
|
||||||
|
print('ERROR: cvc module not found! Install pycvc package.\nTry with `pip install pycvc`')
|
||||||
|
sys.exit(-1)
|
||||||
import json
|
import json
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import base64
|
import base64
|
||||||
|
|||||||
Reference in New Issue
Block a user