Bases: virtualsmartcard.SmartcardFilesystem.File
Class for a dedicated file
Appends ‘file’ to the content of the DF.
Only a template, will raise an error.
list of (tag, length, value)-tuples of BER-TLV coded data objects (encrypted)
list of files of the DF
unknown
string with up to 16 bytes. DF name,which can also be used as applicationidentifier.
Only a template, will raise an error.
file identifier
file descriptor byte
Returns a string of either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘requestedTL’ is a list of (tag, length)-tuples that specify which tags should be returned in what size.
Returns the path to this file beginning with the MF’s fid.
life cycle byte
parent DF
Sets either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘newtlvlist’ is a list of (tag, length, value)-tuples of new data.
Only a template, will raise an error.
Only a template, will raise an error.
Removes ‘file’ from the content of the DF
Returns the first file of the DF, that has the ‘attribute’ with the specified ‘value’. For partial DF name selection you must specify the first/last/next or previous occurence with ‘reference’ and the index of the current file ‘index_current’ (-1 for None).
list of (tag, length, value)-tuples of SIMPLE-TLV coded data objects (encrypted)
Only a template, will raise an error.
Only a template, will raise an error.
Only a template, will raise an error.
Only a template, will raise an error.
Bases: virtualsmartcard.SmartcardFilesystem.File
Template class for an elementary file.
Only a template, will raise an error.
list of (tag, length, value)-tuples of BER-TLV coded data objects (encrypted)
integer. Data coding byte.
Only a template, will raise an error.
file identifier
file descriptor byte
Returns a string of either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘requestedTL’ is a list of (tag, length)-tuples that specify which tags should be returned in what size.
Returns the path to this file beginning with the MF’s fid.
life cycle byte
parent DF
Sets either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘newtlvlist’ is a list of (tag, length, value)-tuples of new data.
Only a template, will raise an error.
Only a template, will raise an error.
Only a template, will raise an error.
integer with 1<=shortfid<=30.Short EF identifier.
list of (tag, length, value)-tuples of SIMPLE-TLV coded data objects (encrypted)
Only a template, will raise an error.
Only a template, will raise an error.
Only a template, will raise an error.
Only a template, will raise an error.
Bases: object
Template class for a smartcard file.
Only a template, will raise an error.
list of (tag, length, value)-tuples of BER-TLV coded data objects (encrypted)
Only a template, will raise an error.
file identifier
file descriptor byte
Returns a string of either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘requestedTL’ is a list of (tag, length)-tuples that specify which tags should be returned in what size.
Returns the path to this file beginning with the MF’s fid.
life cycle byte
parent DF
Sets either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘newtlvlist’ is a list of (tag, length, value)-tuples of new data.
Only a template, will raise an error.
Only a template, will raise an error.
Only a template, will raise an error.
list of (tag, length, value)-tuples of SIMPLE-TLV coded data objects (encrypted)
Only a template, will raise an error.
Only a template, will raise an error.
Only a template, will raise an error.
Only a template, will raise an error.
Bases: virtualsmartcard.SmartcardFilesystem.DF
Class for a master file
Returns the file specified by ‘p1’ and ‘data’ from the select file command APDU.
Appends ‘file’ to the content of the DF.
Function for instruction 0xe2. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Only a template, will raise an error.
list of (tag, length, value)-tuples of BER-TLV coded data objects (encrypted)
list of files of the DF
Creates and returns a list of files according to the parameters of a create file command.
Function for instruction 0xe0. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
the currently selected file
Returns the current DF.
Returns the current EF or None if not available.
unknown
Decodes ‘p1’, ‘p2’ and ‘data’ from a data object handling command (i. e. get/put data) with odd instruction code.
Returns: | the specified file, True if the following list regards SIMPLE-TLV data objects False otherwise and a list of (tag, length, value)-tuples. |
---|
Decodes ‘p1’, ‘p2’ and ‘data’ from a data object handling command (i. e. get/put data) with even instruction code.
Returns: | the specified file, True if the following list regards SIMPLE-TLV data objects False otherwise and a list of (tag, length, value)-tuples. |
---|
Decodes ‘p1’, ‘p2’ and ‘data’ from a data unit command (i. e. read/write/update/search/erase binary) with odd instruction code.
Decodes ‘p1’, ‘p2’ and ‘data’ from a data unit command (i. e. read/write/update/search/erase binary) with even instruction code.
Returns: | the specified TransparentStructureEF, a list of offsets and a list of data strings. |
---|
Function for instruction 0xe4. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
string with up to 16 bytes. DF name,which can also be used as applicationidentifier.
Returns a string of TLV-coded file control information of ‘file’. Note: The result is not prepended with tag and length for neither TCP, FMD nor FCI template.
Function for instruction 0x0f. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0x0e. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0x0c. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Only a template, will raise an error.
file identifier
file descriptor byte
string of length 1. The firstsoftware function table from thehistorical bytes.
Function for instruction 0xcb. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xca. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Returns a string of either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘requestedTL’ is a list of (tag, length)-tuples that specify which tags should be returned in what size.
Returns the path to this file beginning with the MF’s fid.
life cycle byte
Returns a byte according to the first software function table from the historical bytes of the card capabilities.
The second software function table from the historical bytes contains the data coding byte.
parent DF
Function for instruction 0xdb. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xda. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Sets either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘newtlvlist’ is a list of (tag, length, value)-tuples of new data.
Function for instruction 0xb1. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xb0. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xb3. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xb2. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Only a template, will raise an error.
Only a template, will raise an error.
Decodes ‘p1’ and ‘p2’ from a record handling command (i. e. read/write/update/append/search/erase record).
Returns: | the specified RecordStructureEF, the number or identifier of the record and a reference, that specifies which record to select (i. e. the last 3 bits of ‘p1’). |
---|
Removes ‘file’ from the content of the DF
string of length 1. The secondsoftware function table from thehistorical bytes.
Returns the first file of the DF, that has the ‘attribute’ with the specified ‘value’. For partial DF name selection you must specify the first/last/next or previous occurence with ‘reference’ and the index of the current file ‘index_current’ (-1 for None).
Function for instruction 0xa4. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
list of (tag, length, value)-tuples of SIMPLE-TLV coded data objects (encrypted)
Function for instruction 0xd7. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xd6. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xdd. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xdc. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Only a template, will raise an error.
Only a template, will raise an error.
Function for instruction 0xd1. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string. Returns the status bytes as two byte long integer and the response data as binary string.
Function for instruction 0xd0. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Function for instruction 0xd2. Takes the parameter bytes ‘p1’, ‘p2’ as integers and ‘data’ as binary string.
Returns: | the status bytes as two byte long integer and the response data as binary string. |
---|
Only a template, will raise an error.
Only a template, will raise an error.
Bases: object
string. The record’s data.
Class for a Record of an elementary of record structure
Bases: virtualsmartcard.SmartcardFilesystem.EF
Class for an elementary file with record structure.
Returns a list of records.
Parameters: |
|
---|
Returns a list of records and sets the recordpointer to the first record, that matched. Is to be involved by __getRecords.
Parameters: |
|
---|
Returns a list of records. Is to be involved by __getRecords.
Parameters: |
|
---|
Appends a new record to the file, initializing it with the given data string. Sets the recordpointer to the newly created record.
list of (tag, length, value)-tuples of BER-TLV coded data objects (encrypted)
integer. Data coding byte.
Only a template, will raise an error.
Removes a record from the file. ‘num_id’ and ‘reference’ specify the record (see __getRecords).
file identifier
file descriptor byte
Returns a string of either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘requestedTL’ is a list of (tag, length)-tuples that specify which tags should be returned in what size.
Returns the path to this file beginning with the MF’s fid.
Returns True if the records are of fixed size, False otherwise.
Returns True if the EF is of TLV structure, False otherwise.
Returns True if the EF is of cyclic structure, False otherwise.
life cycle byte
integer. maximum length of a record’s data.
parent DF
Sets either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘newtlvlist’ is a list of (tag, length, value)-tuples of new data.
Only a template, will raise an error.
Returns a data string from the given ‘offset’. ‘num_id’ and ‘reference’ specify the record (see __getRecords).
integer. Points to the current record (i. e. index of records).
list of records (encrypted)
Resets the record pointer.
Only a template, will raise an error.
integer with 1<=shortfid<=30.Short EF identifier.
list of (tag, length, value)-tuples of SIMPLE-TLV coded data objects (encrypted)
Only a template, will raise an error.
x.updaterecord(num_id, reference, offset, data) <==> x.writerecord(num_id, reference, offset, data, DCB[“ONETIMEWRITE”])
Only a template, will raise an error.
Writes a data string to the ‘offset’ of a record using the given data coding byte. ‘num_id’ and ‘reference’ specify the record (see __getRecords).
Bases: virtualsmartcard.SmartcardFilesystem.EF
Class for an elementary file with transparent structure.
Only a template, will raise an error.
list of (tag, length, value)-tuples of BER-TLV coded data objects (encrypted)
string (encrypted). The file’s data.
integer. Data coding byte.
Sets (part of) the content of an EF to its logical erased state, sequentially starting from ‘erasefrom’ ending at ‘eraseto’.
file identifier
file descriptor byte
Returns a string of either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘requestedTL’ is a list of (tag, length)-tuples that specify which tags should be returned in what size.
Returns the path to this file beginning with the MF’s fid.
life cycle byte
parent DF
Sets either the file’s BER-TLV or the file’s SIMPLE-TLV coded data objects depending on the bool ‘isSimpleTlv’. ‘newtlvlist’ is a list of (tag, length, value)-tuples of new data.
Returns the string of decrypted data beginning at ‘offset’.
Only a template, will raise an error.
Only a template, will raise an error.
integer with 1<=shortfid<=30.Short EF identifier.
list of (tag, length, value)-tuples of SIMPLE-TLV coded data objects (encrypted)
x.updatebinary(offsets, datalist) <==> x.writebinary(offsets, datalist, DCB[“ONETIMEWRITE”])
Only a template, will raise an error.
Writes pieces of data to the specified offsets honoring the given coding byte.
Parameters: |
|
---|
Only a template, will raise an error.
Returns all indexes of the list, which are specified by ‘reference’ and by the current index ‘index_current’ (-1 for no current item) in the correct order. I. e.:
REF[“IDENTIFIER_FIRST”]: all indexes from first to the last item REF[“IDENTIFIER_LAST”]: all indexes from the last to first item REF[“IDENTIFIER_NEXT”]: all indexes from the next to the last item REF[“IDENTIFIER_PREVIOUS”]: all indexes from the previous to the first item
Returns a list of files according to the given list of reference data objects.
param mf: the MF param refdataobjs: a list of 3-tuples (tag, length, newvalue)
Returns True, if all items are equal, otherwise False
Assigns a property to the calling object. This is used to decorate instance variables with docstrings.
Returns a recursively generated string representation of an object and its attributes.
Walks a path of fids and returns the last file (EF or DF).
Parameters: |
|
---|
Returns the status bytes and the result of a write operation according to the given data coding.
Parameters: |
|
---|