root/middleware-offline/trunk/_src/eidmw/applayer/EMV-Cap-Helper.h @ 267

Revision 267, 1.0 KB (checked in by vsilva, 6 years ago)

Fix change PIN - OTP problem. Update to new MW version 2.2.0 - Stable version

Line 
1/*
2 *  PTeID Middleware Project.
3 *  Copyright (C) 2011-2012
4 *  Luis Medinas <lmedinas@gmail.com>
5 *  Andre Guerreiro <andre.guerreiro@caixamagica.pt>
6 */
7
8#ifndef EMVCAPHELPER_H_
9#define EMVCAPHELPER_H_
10
11namespace eIDMW
12{
13
14#define PANSEQNUMBER "00"
15#define CDOL1 "0000000000000000000000000000800000000000000000000000000000"
16#define COUNTER "0"
17#define PINTRYCOUNTER "3"
18
19struct OTPParams
20{
21char *pan;
22char *pin;
23char *arqc;
24char *cdol1;
25char *atc;
26char *pan_seq_nr;
27char *counter;
28unsigned char pin_try_counter;
29
30};
31
32class EMVCapHelper
33{
34public:
35        EMVCapHelper(APL_Card *card, const char *new_pin);
36        /**
37          * Destructor
38          */
39        ~EMVCapHelper();
40
41        void GetPan();
42        void GetArqc(unsigned char p1);
43        bool getOtpParams(OTPParams *);
44        char *changeCapPin(char * change_apdu_str);
45        char *resetScriptCounter(char *cdol2);
46        void getOnlineTransactionParams(OTPParams *);
47private:
48        bool checkSW12(CByteArray &in);
49        APL_Card *m_card;
50        char *m_pan;
51        char *m_arqc;
52        char *m_atc;
53        unsigned char m_trycounter;
54        const char *m_new_pin;
55};
56
57}
58#endif /* EMVCAPHELPER_H_ */
Note: See TracBrowser for help on using the browser.