smartcard.sw.ErrorChecker.ErrorChecker

# ``smartcard`.`sw`.`ErrorChecker`.`ErrorChecker``

class documentation

`class ErrorChecker(object):`

Known subclasses: `smartcard.sw.ISO7816_4_SW1ErrorChecker.ISO7816_4_SW1ErrorChecker`, `smartcard.sw.ISO7816_4ErrorChecker.ISO7816_4ErrorChecker`, `smartcard.sw.ISO7816_8ErrorChecker.ISO7816_8ErrorChecker`, `smartcard.sw.ISO7816_9ErrorChecker.ISO7816_9ErrorChecker`, `smartcard.sw.op21_ErrorChecker.op21_ErrorChecker`

View In Hierarchy

Base class for status word error checking strategies.

Error checking strategies are chained into an `ErrorCheckingChain` to implement a Chain of Responsibility. Each strategy in the chain is called until an error is detected. The strategy raises a `smartcard.sw.SWExceptions` exception when an error is detected.

Implementation derived from Bruce Eckel, Thinking in Python. The `ErrorCheckingChain` implements the Chain Of Responsibility design pattern.

Method | `__call__` | Called to test data, sw1 and sw2 for error.

def __call__(data, sw1, sw2):
overridden in `smartcard.sw.ISO7816_4_SW1ErrorChecker.ISO7816_4_SW1ErrorChecker`, `smartcard.sw.ISO7816_4ErrorChecker.ISO7816_4ErrorChecker`, `smartcard.sw.ISO7816_8ErrorChecker.ISO7816_8ErrorChecker`, `smartcard.sw.ISO7816_9ErrorChecker.ISO7816_9ErrorChecker`, `smartcard.sw.op21_ErrorChecker.op21_ErrorChecker`

Called to test data, sw1 and sw2 for error.

Derived classes must raise a `smartcard.sw.SWExceptions` upon error.

Parameters
data | apdu response data
sw1 | apdu data status word 1
sw2 | apdu data status word 2