Code documentation
ragger.error
- class ragger.error.ExceptionRAPDU(status: int, data: bytes = b'')
Depending on the
RaisePolicy
, communication with an application can raise this exception.Just like
RAPDU
, it is composed of two attributes:status
(int
), which is extracted from the two last bytes of the response,data
(bytes
), which is the entire response payload, except the two last bytes.
ragger.firmware
Most Ragger
high-level class needs to know which Firmware they
should expect. This is declared with this class:
- class ragger.firmware.Firmware(value)
Bases:
IntEnum
An enumeration.
- NANOS = 1
- NANOSP = 2
- NANOX = 3
- STAX = 4
- FLEX = 5
- property device: str
A proxy property for
Firmware.name
. This property is deprecated. It is advise to not use it.
- property is_nano
States if the firmware’s name starts with ‘nano’ or not.
- property name: str
Returns the name of the current firmware’s device
ragger.utils
ragger.utils.structs
- class ragger.utils.structs.RAPDU(status: int, data: bytes)
The dataclass containing the application’s response of an APDU from the client to the application.
It is composed of two attributes:
status
(int
): from the two last bytes of the payload. Common values are 0x9000 for success, other being errors.data
(bytes
): the rest of the response (the entire payload without the two last bytes)