File Permissions
Source code in src/desfire/schemas/file_permissions.py
__init__ ¶
This class represents the permissions of a file on a DESFire card.
Each permission represents a key number within the application that should be used to obtain the corresponding access rights. Each of them is a 4-bit value, where the bits are as follows:
- 0x0 - 0xD Key number that should be used to obtain the corresponding access rights
- 0xE No restrictions (free access)
- 0xF No Access allowed
Source code in src/desfire/schemas/file_permissions.py
__repr__ ¶
Returns a human readable representation of the file permissions.
TODO: Update this to reflect the actual permissions
Source code in src/desfire/schemas/file_permissions.py
get_permissions ¶
Returns the permissions as a list of two bytes.
Source code in src/desfire/schemas/file_permissions.py
parse ¶
Parse the raw data into a FilePermissions object. Raw data is two bytes, split into 4-bit values.
Source: https://github.com/EsupPortail/esup-nfc-tag-server/blob/295aed8cbcf09323cf859fa5753b5482ce7eee3c/src/main/java/org/esupportail/nfctag/service/desfire/DESFireEV1Service.java#L1889
- File permissions are (MSB = start):
-
- 0b - 3b: Read-Write key
-
- 4b - 7b: Change permission key
-
- 8b - 11b: Read key
-
- 12b - 15b: Write key
Example Data: 0x00 0x23