protected boolean readWithPSE ( ) throws CommunicationException { boolean ret = false ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Try to read card with Payment System Environment" ) ; } // Select the payment environment PPSE or PSE directory byte [ ] data = selectPaymentEnvironment ( ) ; if ( ResponseUtils . isSucceed ( data ) ) { // Parse FCI Template card . getApplications ( ) . addAll ( parseFCIProprietaryTemplate ( data ) ) ; Collections . sort ( card . getApplications ( ) ) ; // For each application for ( Application app : card . getApplications ( ) ) { boolean status = false ; String applicationAid = BytesUtils . bytesToStringNoSpace ( app . getAid ( ) ) ; for ( IParser impl : parsers ) { if ( impl . getId ( ) != null && impl . getId ( ) . matcher ( applicationAid ) . matches ( ) ) { status = impl . parse ( app ) ; break ; } } if ( ! ret && status ) { ret = status ; if ( ! config . readAllAids ) { break ; } } } if ( ! ret ) { card . setState ( CardStateEnum . LOCKED ) ; } } else if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( ( config . contactLess ? "PPSE" : "PSE" ) + " not found -> Use kown AID" ) ; } return ret ; }
Read EMV card with Payment System Environment or Proximity Payment System Environment