diff --git a/main.py b/main.py index b4a87ce..ec49072 100644 --- a/main.py +++ b/main.py @@ -3,6 +3,7 @@ import random from pkg.lib.CIEInterface import CIEInterface +import cv2 __author__ = "Alekos Filini, Daniela Brozzoni" __license__ = "BSD-3-Clause" @@ -22,24 +23,30 @@ def main(): ' ╚═════╝╚═╝╚══════╝╚═════╝ \n') interface = CIEInterface() + nis = interface.readNIS() + print(nis) interface.mrtdAuth('YYMMDD', 'YYMMDD', '*********') - data = interface.extractData() + data = interface.extractAdditionalDetails() + mrz = interface.extractMRZ() + interface.extractPhoto() + image = cv2.imread('img.jpeg') + cv2.imwrite('img.png', image) - print ('Nome e cognome: {}\n' \ + print ('\nNome e cognome: {}\n' \ 'Codice fiscale: {}\n' \ 'Residenza: {}\n' \ 'Luogo di nascita: {}\n' \ 'Data di nascita: {}\n\n' \ 'MRZ: {}' \ - .format(data['additional_details']['full_name'].replace('<<', ' '), - hide_sensitive_data(data['additional_details']['vat_code']), - hide_sensitive_data(data['additional_details']['address'].replace('<', ' ')), - data['additional_details']['birth_place'].replace('<', ' '), - data['additional_details']['birth_date'], + .format(data['full_name'].replace('<<', ' '), + hide_sensitive_data(data['vat_code']), + hide_sensitive_data(data['address'].replace('<', ' ')), + data['birth_place'].replace('<', ' '), + data['birth_date'], - hide_sensitive_data(data['mrz']))) + hide_sensitive_data(mrz))) - print('Immagine salvata in: img.jpeg') + print('Immagine salvata in: img.png') if __name__ == "__main__": diff --git a/pkg/lib/CIEInterface.py b/pkg/lib/CIEInterface.py index f85ee1b..12772fc 100644 --- a/pkg/lib/CIEInterface.py +++ b/pkg/lib/CIEInterface.py @@ -34,7 +34,7 @@ def __init__(self): """ cardtype = AnyCardType() - cardrequest = CardRequest(timeout=3, cardType=cardtype) + cardrequest = CardRequest(timeout=30, cardType=cardtype) self.seq = None self.kSessEnc = None