File Settings
Source code in src/desfire/schemas/file_settings.py
__init__ ¶
__init__(
encryption: DESFireCommunicationMode | None = None,
file_type: DESFireFileType | None = None,
permissions: FilePermissions | None = None,
file_size: int = 0,
)
Initialize the FileSettings object
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
encryption
|
DESFireCommunicationMode | None
|
Encryption mode that should be applied to the file. Can be plain (anyone can read/write), MACed (only authenticated users can read/write) or encrypted (only authenticated users can read/write). |
None
|
file_type
|
DESFireFileType | None
|
Type of the file. Currently only standard files are supported. |
None
|
permissions
|
FilePermissions | None
|
Permissions that should be applied to the file. Refer to the FilePermissions class for more information. |
None
|
file_size
|
int
|
File size in bytes. Only used for standard data files. |
0
|
Source code in src/desfire/schemas/file_settings.py
__repr__ ¶
Returns a human readable representation of the file settings.
Source code in src/desfire/schemas/file_settings.py
parse ¶
Takes raw data from command 0xF5 (get file settings) and parses it into a FileSettings object.
Example of a raw data from command 0xF5 (get file settings on a standard data file):
00 03 00 23 08 00 00
^^ ^^ ^^^^^ ^^^^^^^^
| | | |
| | | ^ File Size (3 bytes)
| | ^ File Permissions (2 bytes)
| ^ Communication / Encryption mode (1 byte)
^ File Type (1 byte)
There are four other file types that are not implemented yet.