|
M5Unit-NFC 0.0.3 git rev:59f5362
|
ISO/IEC 7816-4 file system. More...
#include <file_system.hpp>
Public Member Functions | |
| FileSystem (m5::nfc::isodep::IsoDEP &isoDEP) | |
| const std::vector< uint8_t > & | lastSelectData () const |
| Last SELECT response data (SW excluded) | |
ISO/IEC 7816-4 Standard commands | |
| bool | createFile (const uint8_t *fcp, const uint16_t fcp_len) |
| CREATE FILE. | |
| bool | createFile (const FCP &fcp) |
| CREATE FILE. | |
| bool | createFile (const uint16_t fid, const uint16_t file_size) |
| CREATE FILE. | |
| bool | selectFile (const m5::nfc::apdu::SelectBy by, const m5::nfc::apdu::SelectOccurrence occ, const m5::nfc::apdu::SelectResponse res, const uint8_t *param, const uint8_t param_len) |
| SELECT FILE (generic) | |
| bool | selectByFileId (const uint16_t fid, const m5::nfc::apdu::SelectResponse res=m5::nfc::apdu::SelectResponse::FCI, const m5::nfc::apdu::SelectOccurrence occ=m5::nfc::apdu::SelectOccurrence::FirstOrOnly) |
| SELECT by File ID with explicit response type. | |
| bool | selectFileIdAuto (const uint16_t fid, const m5::nfc::apdu::SelectOccurrence occ=m5::nfc::apdu::SelectOccurrence::FirstOrOnly) |
| SELECT by File ID with auto response fallback (None->FCI->FCP) | |
| bool | selectByDfName (const uint8_t *aid, const uint8_t aid_len, const m5::nfc::apdu::SelectResponse res=m5::nfc::apdu::SelectResponse::FCI, const m5::nfc::apdu::SelectOccurrence occ=m5::nfc::apdu::SelectOccurrence::FirstOrOnly) |
| SELECT by DF Name with explicit response type. | |
| bool | selectDfNameAuto (const uint8_t *aid, const uint8_t aid_len, const m5::nfc::apdu::SelectOccurrence occ=m5::nfc::apdu::SelectOccurrence::FirstOrOnly) |
| SELECT by DF Name with auto response fallback (FCI->None->FCP) | |
| bool | selectByPath (const uint8_t *path, const uint8_t path_len, const bool from_mf=true, const m5::nfc::apdu::SelectResponse res=m5::nfc::apdu::SelectResponse::FCI, const m5::nfc::apdu::SelectOccurrence occ=m5::nfc::apdu::SelectOccurrence::FirstOrOnly) |
| SELECT by path (MF or current DF) | |
| bool | selectParent (const m5::nfc::apdu::SelectResponse res=m5::nfc::apdu::SelectResponse::FCI, const m5::nfc::apdu::SelectOccurrence occ=m5::nfc::apdu::SelectOccurrence::FirstOrOnly) |
| SELECT parent DF. | |
| bool | selectMasterFile () |
| SELECT MF (Master File) | |
| bool | verify (const uint8_t *password, const uint16_t pass_len, const uint8_t param2) |
| VERIFY (generic) | |
| bool | verifyGlobal (const uint8_t *password, const uint16_t pass_len) |
| VERIFY global reference data. | |
| bool | verifySpecific (const uint8_t *password, const uint16_t pass_len) |
| VERIFY specific reference data. | |
| bool | readBinary (std::vector< uint8_t > &out, const uint16_t offset, const uint16_t le) |
| READ BINARY. | |
| bool | updateBinary (const uint16_t offset, const uint8_t *data, const uint16_t data_len) |
| UPDATE BINARY. | |
Protected Attributes | |
| m5::nfc::isodep::IsoDEP & | _isoDEP |
| std::vector< uint8_t > | _last_select_fci {} |
ISO/IEC 7816-4 file system.
| bool m5::nfc::FileSystem::createFile | ( | const FCP & | fcp | ) |
CREATE FILE.
| fcp | File control parameters |
| bool m5::nfc::FileSystem::createFile | ( | const uint16_t | fid, |
| const uint16_t | file_size ) |
CREATE FILE.
| fid | FileID |
| file_size | File size |
| bool m5::nfc::FileSystem::createFile | ( | const uint8_t * | fcp, |
| const uint16_t | fcp_len ) |
CREATE FILE.
| fcp | File control parameters |
| fcp_len | fcp length |
|
inline |
Last SELECT response data (SW excluded)
| bool m5::nfc::FileSystem::readBinary | ( | std::vector< uint8_t > & | out, |
| const uint16_t | offset, | ||
| const uint16_t | le ) |
READ BINARY.
| [out] | out | Output buffer |
| offset | File offset | |
| le | Expected length (1..256 recommended) |
| bool m5::nfc::FileSystem::selectByDfName | ( | const uint8_t * | aid, |
| const uint8_t | aid_len, | ||
| const m5::nfc::apdu::SelectResponse | res = m5::nfc::apdu::SelectResponse::FCI, | ||
| const m5::nfc::apdu::SelectOccurrence | occ = m5::nfc::apdu::SelectOccurrence::FirstOrOnly ) |
SELECT by DF Name with explicit response type.
| aid | DF name (AID) |
| aid_len | AID length |
| res | Response format |
| occ | Selection occurrence |
| bool m5::nfc::FileSystem::selectByFileId | ( | const uint16_t | fid, |
| const m5::nfc::apdu::SelectResponse | res = m5::nfc::apdu::SelectResponse::FCI, | ||
| const m5::nfc::apdu::SelectOccurrence | occ = m5::nfc::apdu::SelectOccurrence::FirstOrOnly ) |
SELECT by File ID with explicit response type.
| fid | File ID |
| res | Response format |
| occ | Selection occurrence |
| bool m5::nfc::FileSystem::selectByPath | ( | const uint8_t * | path, |
| const uint8_t | path_len, | ||
| const bool | from_mf = true, | ||
| const m5::nfc::apdu::SelectResponse | res = m5::nfc::apdu::SelectResponse::FCI, | ||
| const m5::nfc::apdu::SelectOccurrence | occ = m5::nfc::apdu::SelectOccurrence::FirstOrOnly ) |
SELECT by path (MF or current DF)
| path | Path data |
| path_len | Path length |
| from_mf | Use MF as origin if true |
| res | Response format |
| occ | Selection occurrence |
| bool m5::nfc::FileSystem::selectDfNameAuto | ( | const uint8_t * | aid, |
| const uint8_t | aid_len, | ||
| const m5::nfc::apdu::SelectOccurrence | occ = m5::nfc::apdu::SelectOccurrence::FirstOrOnly ) |
SELECT by DF Name with auto response fallback (FCI->None->FCP)
| aid | DF name (AID) |
| aid_len | AID length |
| occ | Selection occurrence |
| bool m5::nfc::FileSystem::selectFile | ( | const m5::nfc::apdu::SelectBy | by, |
| const m5::nfc::apdu::SelectOccurrence | occ, | ||
| const m5::nfc::apdu::SelectResponse | res, | ||
| const uint8_t * | param, | ||
| const uint8_t | param_len ) |
SELECT FILE (generic)
| by | Selection method |
| occ | Selection occurrence |
| res | Response format |
| param | Identifier data |
| param_len | Identifier length |
| bool m5::nfc::FileSystem::selectFileIdAuto | ( | const uint16_t | fid, |
| const m5::nfc::apdu::SelectOccurrence | occ = m5::nfc::apdu::SelectOccurrence::FirstOrOnly ) |
SELECT by File ID with auto response fallback (None->FCI->FCP)
| fid | File ID |
| occ | Selection occurrence |
|
inline |
SELECT MF (Master File)
| bool m5::nfc::FileSystem::selectParent | ( | const m5::nfc::apdu::SelectResponse | res = m5::nfc::apdu::SelectResponse::FCI, |
| const m5::nfc::apdu::SelectOccurrence | occ = m5::nfc::apdu::SelectOccurrence::FirstOrOnly ) |
SELECT parent DF.
| res | Response format |
| occ | Selection occurrence |
| bool m5::nfc::FileSystem::updateBinary | ( | const uint16_t | offset, |
| const uint8_t * | data, | ||
| const uint16_t | data_len ) |
UPDATE BINARY.
| offset | File offset |
| data | Data to write |
| data_len | Length to write |
| bool m5::nfc::FileSystem::verify | ( | const uint8_t * | password, |
| const uint16_t | pass_len, | ||
| const uint8_t | param2 ) |
VERIFY (generic)
| password | Password data |
| pass_len | Password length |
| param2 | P2 (reference data type) |
|
inline |
VERIFY global reference data.
| password | Password data |
| pass_len | Password length |
|
inline |
VERIFY specific reference data.
| password | Password data |
| pass_len | Password length |