1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2020 A. Ozkal
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
8 // High frequency Electronic Machine Readable Travel Document commands
9 //-----------------------------------------------------------------------------
11 #ifndef CMDHFEMRTD_H__
12 #define CMDHFEMRTD_H__
16 typedef struct emrtd_dg_s
{
23 bool eac
; // EAC only (we can't dump these)
24 bool required
; // some are required only if PACE
25 bool fastdump
; // fast to dump
26 int (*parser
)(uint8_t *data
, size_t datalen
);
27 int (*dumper
)(uint8_t *data
, size_t datalen
, const char *path
);
30 typedef struct emrtd_hashalg_s
{
32 int (*hasher
)(uint8_t *datain
, int datainlen
, uint8_t *dataout
);
35 const uint8_t descriptor
[15];
38 typedef struct emrtd_pacealg_s
{
40 int (*keygenerator
)(uint8_t *datain
, int datainlen
, uint8_t *dataout
);
41 const uint8_t descriptor
[10];
44 // Standardized Domain Parameters
45 typedef struct emrtd_pacesdp_s
{
51 int CmdHFeMRTD(const char *Cmd
);
53 int dumpHF_EMRTD(char *documentnumber
, char *dob
, char *expiry
, bool BAC_available
, const char *path
);
54 int infoHF_EMRTD(char *documentnumber
, char *dob
, char *expiry
, bool BAC_available
);
55 int infoHF_EMRTD_offline(const char *path
);