Exemple #1
0
 def __init__(self, reader, maxSize = 0xDF):
     """ 
     @param reader: A Reader
     @type Reader
     @param maxSize: The maximum buffer size accepted by the reader.
     @type maxSize: An integer (hexa)
     """
     Logger.__init__(self, "JCOP")
     self._maxSize = maxSize
     self._iso7816 = iso7816.Iso7816(reader)
    def __init__(self, ds, dsKey, reader=None):
        """  
        @param ds: The Document Sgner certificate in PEM
        @param dsKey: The associated ds private key
        """
        Logger.__init__(self, "EPCreation")
        self._ds = ds
        self._dsKey = dsKey
        if reader: self._iso7816 = iso7816.Iso7816(reader)
        else: self._iso7816 = None

        self._jcopW = JavaCardWritter(reader)

        self._openssl = OpenSSL()
        self._forged = None
        self._openssl.register(self._traceOpenssl)
Exemple #3
0
    def __init__(self, reader, epMrz=None):
        """ 
        This object provide most of the functionnalities described in the EPassport document.
            - The basic acces control + secure messaging
            - The active authentication
            - The passive authentication
            - Reading of the various dataGroups
        
        @param reader: It can be a reader or a path to dumps
        @type reader: A reader object, then it will use the specified rfid reader. 
                      A string, then the simulator will read the dumps from the specified url.  
        
        @param mrz: An object representing the passport MRZ.
        @type mrz: An MRZ object 
        """
        logger.Logger.__init__(self, "EPassport")

        if epMrz:
            self._mrz = mrz.MRZ(epMrz)
            if self._mrz.checkMRZ() == False:
                raise EPassportException("Invalid MRZ")
        else:
            self._mrz = None

        self._iso7816 = iso7816.Iso7816(reader)
        self._iso7816.register(self._logFct)

        self._dgReader = datagroup.DataGroupReaderFactory().create(
            self._iso7816)
        self._dgReader.register(self._logFct)

        self._bac = bac.BAC(self._iso7816)
        self._bac.register(self._logFct)

        self._openSSL = openssl.OpenSSL()
        self._openSSL.register(self._logFct)

        self._aa = activeauthentication.ActiveAuthentication(
            self._iso7816, self._openSSL)
        self._aa.register(self._logFct)

        self._pa = passiveauthentication.PassiveAuthentication(self._openSSL)
        self._pa.register(self._logFct)

        self._CSCADirectory = None
        self._selectPassportApp()