#ifndef TC_HEADER_Common_EMVCard #define TC_HEADER_Common_EMVCard #include "Platform/PlatformBase.h" #if defined (TC_WINDOWS) && !defined (TC_PROTOTYPE) # include "Exception.h" #else # include "Platform/Exception.h" #endif #include "Token.h" #include "SCard.h" namespace VeraCrypt { typedef enum EMVCardType { NONE = 0, AMEX, MASTERCARD, VISA } EMVCardType; class EMVCard : public SCard { protected: // The following fields will only be empty if the card has not been read yet. // After the card has been read, and if some or all fields cannot be read, the EMVCard // object will be considered invalid and will not be included in the list of available cards // of EMVToken. vector m_aid; vector> m_supportedAids; vector m_iccCert; vector m_issuerCert; vector m_cplcData; wstring m_lastPANDigits; public: // Add other AIDS // https://gist.github.com/pvieito/6224eed92c99b069f6401996c548d0e4 // https://ambimat.com/developer-resources/list-of-application-identifiers-aid/ const static uint8 AMEX_AID[7]; const static uint8 MASTERCARD_AID[7]; const static uint8 VISA_AID[7]; const static map> SUPPORTED_AIDS; EMVCard(); EMVCard(size_t slotId); EMVCard(const EMVCard& other); EMVCard(EMVCard&& other); EMVCard& operator = (const EMVCard& other); EMVCard& operator = (EMVCard&& other); virtual ~EMVCard(); void Clear(void); // Retrieves the card's AID. // It first checks the card against a list of supported AIDs. // If that fails, it tries getting the AID from the card using PSE vector GetCardAID(bool forceContactless = false); void GetCardContent(vector& iccCert, vector& issuerCert, vector& cplcData); void GetCardPAN(wstring& lastPANDigits); }; } #endif // TC_HEADER_Common_EMVCard n2_1.26.13&id=e3af024e5ba0a0b5a18a8b843857c7a92e0ca79d'>commitdiff
blob: 1876c84f0c604502b55e0806b109f733f0200068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79