recover_pk.py: replace secp192r1 by prime192v1
[RRG-proxmark3.git] / client / src / emv / emvjson.h
blob630a659f2e135ed2abd21c7003b2b025557c9aab
1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
16 // EMV json logic
17 //-----------------------------------------------------------------------------
18 #ifndef EMVJSON_H__
19 #define EMVJSON_H__
21 #include "common.h"
23 #include "jansson.h"
24 #include "jansson_path.h"
25 #include "tlv.h"
27 typedef struct {
28 tlv_tag_t Tag;
29 const char *Name;
30 } ApplicationDataElm_t;
32 const char *GetApplicationDataName(tlv_tag_t tag);
34 int JsonSaveJsonObject(json_t *root, const char *path, json_t *value);
35 int JsonSaveStr(json_t *root, const char *path, const char *value);
36 int JsonSaveBoolean(json_t *root, const char *path, bool value);
37 int JsonSaveInt(json_t *root, const char *path, int value);
38 int JsonSaveBufAsHexCompact(json_t *elm, const char *path, uint8_t *data, size_t datalen);
39 int JsonSaveBufAsHex(json_t *elm, const char *path, uint8_t *data, size_t datalen);
40 int JsonSaveHex(json_t *elm, const char *path, uint64_t data, int datalen);
42 int JsonSaveTLVValue(json_t *root, const char *path, struct tlvdb *tlvdbelm);
43 int JsonSaveTLVElm(json_t *elm, const char *path, struct tlv *tlvelm, bool saveName, bool saveValue, bool saveAppDataLink);
44 int JsonSaveTLVTreeElm(json_t *elm, const char *path, struct tlvdb *tlvdbelm, bool saveName, bool saveValue, bool saveAppDataLink);
46 int JsonSaveTLVTree(json_t *root, json_t *elm, const char *path, struct tlvdb *tlvdbelm);
48 int JsonLoadStr(json_t *root, const char *path, char *value);
49 int JsonLoadBufAsHex(json_t *elm, const char *path, uint8_t *data, size_t maxbufferlen, size_t *datalen);
51 bool ParamLoadFromJson(struct tlvdb *tlv);
53 #endif