1 //-----------------------------------------------------------------------------
2 // Borrowed initially from https://github.com/lumag/emv-tools/
3 // Copyright (C) 2012, 2015 Dmitry Eremin-Solenikov
4 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // See LICENSE.txt for the text of the license.
17 //-----------------------------------------------------------------------------
18 // libopenemv - a library to work with EMV family of smart cards
19 //-----------------------------------------------------------------------------
29 unsigned char serial
[3];
30 unsigned char pan
[10];
31 unsigned char hash_algo
;
32 unsigned char pk_algo
;
33 unsigned char hash
[20];
37 unsigned char *modulus
;
41 #define EXPIRE(yy, mm, dd) 0x ## yy ## mm ## dd
43 struct emv_pk
*emv_pk_parse_pk(char *buf
, size_t buflen
);
44 struct emv_pk
*emv_pk_new(size_t modlen
, size_t explen
);
45 void emv_pk_free(struct emv_pk
*pk
);
46 char *emv_pk_dump_pk(const struct emv_pk
*pk
);
47 bool emv_pk_verify(const struct emv_pk
*pk
);
49 char *emv_pk_get_ca_pk_file(const char *dirname
, const unsigned char *rid
, unsigned char idx
);
50 char *emv_pk_get_ca_pk_rid_file(const char *dirname
, const unsigned char *rid
);
51 struct emv_pk
*emv_pk_get_ca_pk(const unsigned char *rid
, unsigned char idx
);