| 1 | /* |
| 2 | * libopenemv - a library to work with EMV family of smart cards |
| 3 | * Copyright (C) 2015 Dmitry Eremin-Solenikov |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #ifndef EMV_PKI_H |
| 17 | #define EMV_PKI_H |
| 18 | |
| 19 | #include "emv_pk.h" |
| 20 | #include "tlv.h" |
| 21 | |
| 22 | #include <stddef.h> |
| 23 | |
| 24 | extern void PKISetStrictExecution(bool se); |
| 25 | |
| 26 | unsigned char *emv_pki_sdatl_fill(const struct tlvdb *db, size_t *sdatl_len); |
| 27 | struct emv_pk *emv_pki_recover_issuer_cert(const struct emv_pk *pk, struct tlvdb *db); |
| 28 | struct emv_pk *emv_pki_recover_icc_cert(const struct emv_pk *pk, struct tlvdb *db, const struct tlv *sda_tlv); |
| 29 | struct emv_pk *emv_pki_recover_icc_pe_cert(const struct emv_pk *pk, struct tlvdb *db); |
| 30 | |
| 31 | struct tlvdb *emv_pki_recover_dac(const struct emv_pk *pk, const struct tlvdb *db, const struct tlv *sda_tlv); |
| 32 | struct tlvdb *emv_pki_recover_dac_ex(const struct emv_pk *pk, const struct tlvdb *db, const struct tlv *sda_tlv, bool showData); |
| 33 | struct tlvdb *emv_pki_recover_idn(const struct emv_pk *pk, const struct tlvdb *db, const struct tlv *dyn_tlv); |
| 34 | struct tlvdb *emv_pki_recover_idn_ex(const struct emv_pk *pk, const struct tlvdb *db, const struct tlv *dyn_tlv, bool showData); |
| 35 | struct tlvdb *emv_pki_recover_atc_ex(const struct emv_pk *enc_pk, const struct tlvdb *db, bool showData); |
| 36 | struct tlvdb *emv_pki_perform_cda(const struct emv_pk *enc_pk, const struct tlvdb *db, |
| 37 | const struct tlvdb *this_db, |
| 38 | const struct tlv *pdol_data_tlv, |
| 39 | const struct tlv *crm1_tlv, |
| 40 | const struct tlv *crm2_tlv); |
| 41 | struct tlvdb *emv_pki_perform_cda_ex(const struct emv_pk *enc_pk, const struct tlvdb *db, |
| 42 | const struct tlvdb *this_db, |
| 43 | const struct tlv *pdol_data_tlv, |
| 44 | const struct tlv *crm1_tlv, |
| 45 | const struct tlv *crm2_tlv, |
| 46 | bool showData); |
| 47 | |
| 48 | #endif |