Skip to main content

Application Development Kit (Version 4.8)


sdi_if.h

Last updated: 13-Jun-2025
Go to the documentation of this file.
    1 /****************************************************************************    2 *  Product:     ADK Secure Data Interface (SDI)    3 *  Company:     Verifone    4 *  Author:      GSS R&D Germany    5 *  Content:     Client (structure) interface - non-EMV part    6 ****************************************************************************/    7 #ifndef CLIENT_SDI_IF_H_    8 #define CLIENT_SDI_IF_H_    9     10 #ifndef DOXYGEN   11 #ifdef __cplusplus   12 #endif   13 #include <vector>   14 #include <string>   15 #include <stdint.h>   16 #include <emv/EMV_Common_Interface.h> // for EMV_ADK_INFO   17 #include <sysinfo/sysinfo.h> // for property enumerations   18 #include <html/prt.h> // for printer property enumerations   19     20 namespace libsdi {   21     25 enum SDI_SW12   26 {   27   SDI_SW12_NONE = 0,    28   SDI_SW12_SUCCESS = 0x9000,    29     30   SDI_SW12_TAG_ERROR = 0x6200,    31   SDI_SW12_TAG_LENGTH_ERROR = 0x6300,    32   SDI_SW12_EXEC_ERROR = 0x6400,    33   SDI_SW12_CANCELED_BY_USER = 0x6405,    34   SDI_SW12_BUSY = 0x640A,    35   SDI_SW12_TIMEOUT_PIN_ENTRY = 0x640C,    36   SDI_SW12_TIMEOUT_CARD_REMOVAL = 0x64F7,    37   SDI_SW12_INTERCHAR_PIN_ENTRY = 0x64F8,    38   SDI_SW12_COMMAND_NOT_ALLOWED = 0x64F9,    39   SDI_SW12_MAIN_CONNECTION_USED = 0x64FA,    40   SDI_SW12_INVALID_FILE_CONTENT = 0x64FB,    41   SDI_SW12_FILE_ACCESS_ERROR = 0x64FC,    42   SDI_SW12_LOGIC_ERROR = 0x64FD,    43   SDI_SW12_SDI_PARAMETER_ERROR = 0x64FE,    44   SDI_SW12_LUHN_CHECK_FAILED = 0x64FF,    45   SDI_SW12_EXECUTION_ABORTED = 0x6500,    46   SDI_SW12_EXECUTION_TIMEOUT = 0x6600,    47   SDI_SW12_MESSAGE_LENGTH_ERROR = 0x6700,    48     49   SDI_SW12_NO_SDI_PLUGIN_AVAILABLE = 0x6800,    50   SDI_SW12_UNKNOWN_PLUGIN_ID = 0x6801,    51   SDI_SW12_UNKNOWN_PLUGING_ID = 0x6801,    52   SDI_SW12_INVALID_PLUGIN_RESPONSE = 0x6802,    53     54   SDI_SW12_EPP_CONNECTION_ERROR = 0x6900,    55     56   SDI_SW12_UNKNOWN_INS_BYTE = 0x6D00,    57   SDI_SW12_UNKNOWN_CLA_BYTE = 0x6E00,    58     59   SDI_SW12_CMAC_ERROR = 0x6FB0,    60   SDI_SW12_CMAC_LENGTH_ERROR = 0x6FB1,    61   SDI_SW12_CMAC_MISSING_ERROR = 0x6FB2,    62   SDI_SW12_ENCRYPTION_ERROR = 0x6FB4,    63   SDI_SW12_ENCRYPTION_LENGTH_ERROR = 0x6FB5,    64   SDI_SW12_ENCRYPTION_MISSING_ERROR = 0x6FB6,    65   SDI_SW12_DECRYPTION_ERROR = 0x6FB8,    66   SDI_SW12_DECRYPTION_LENGTH_ERROR = 0x6FB9,    67   SDI_SW12_DECRYPTION_MISSING_ERROR = 0x6FBA,    68     69   SDI_SW12_EXCESSIVE_PIN_REQUESTS = 0x6FC0,    70   SDI_SW12_LOW_BATTERY = 0x6FD0,    71   SDI_SW12_NO_DUKPT_KEYS_LOADED = 0x6FE0,    72   SDI_SW12_UNIT_TAMPERED = 0x6FF0,    73   SDI_SW12_RECOVERY_MODE = 0x6FF1,    74     75   SDI_SW12_PIN_BYPASSED = 0x9070,    76   SDI_SW12_NO_MACTCH_FOR_CARD_VALIDATION = 0x9071,    77   SDI_SW12_SMART_CARD_REMOVED = 0x9401,    78   SDI_SW12_SMART_CARD_ERROR_TRM = 0x9402,    79   SDI_SW12_SMART_CARD_ERROR = 0x9403,    80   SDI_SW12_TWO_CARDS = 0x9404,    81   SDI_SW12_SMART_CARD_ERR_INIT = 0x9405,    82   SDI_SW12_SMART_CARD_ERR_PARAM = 0x9406,    83   SDI_SW12_EMV_TLV_ERROR = 0x94F3, // error In TLV data object (only in relation with EMV commands)   84     85   // There are from previous header version and kept for backward compatibility   86   SDI_SW12_ERROR = 0x6400,    87   SDI_SW12_TIMEOUT = 0x6600,    88   SDI_SW12_NOT_ALLOWED = 0x64FD,    89   SDI_SW12_PARAMETER_ERROR = 0x90E6    90 };   91     99 enum SDICLIENT_ERROR  100 {  101   SDICLIENT_ERROR_NONE = 0,             102   SDICLIENT_ERROR_COMMUNICATION = -1,   103   SDICLIENT_ERROR_CONCURRENT_USE = -2,  104   SDICLIENT_ERROR_CONNECT = -3,         105   SDICLIENT_ERROR_OVERFLOW = -4,        106   SDICLIENT_ERROR_PARAM = -5,           107   SDICLIENT_ERROR_OTHER = -6,           108   SDICLIENT_ERROR_NO_RECEIVE = -7,      109   SDICLIENT_ERROR_NOT_SUPPORTED = -10,  111   SDICLIENT_ERROR_NOT_ALLOWED = -11     112 };  113    114 #define MSR_CLIENT_ERROR_OFFSET   100   115    116 #define VALIDATION_CHECK_OPTION_RETURN_ALL_MATCHING_RANGES       0x01  //Return all matching card ranges. per default only the best match is returned  117    121 enum SDICLIENT_ERROR getNfcClientError();  122    126 enum SDI_SW12 getNfcSW12();  127    128 struct MatchingRecord  129 {  130   std::string json;  131   unsigned char expirycheck_result;  132   unsigned char luhncheck_result;  133   unsigned char activationcheck_result;  134   MatchingRecord(const std::string &_json): json(_json), expirycheck_result(0xFF), luhncheck_result(0xFF), activationcheck_result(0xFF){};  135 };  136    138 enum SYSUploadType {  139   SYS_UPLOAD_SOFTWARE_UPDATE,          140   SYS_UPLOAD_CONFIG_WHITELIST,         141   SYS_UPLOAD_CONFIG_SENSITIVE_TAGS,    142   SYS_UPLOAD_CONFIG_CARD_RANGES,       143   SYS_UPLOAD_INSTALL_CP_PACKAGE = 11,  144   SYS_UPLOAD_EMV_CONFIGURATION         145 };  146    147    151 class SdiBase  152 {  153 protected:  154   unsigned short sw12;  155   int additionalResultValue;  156   SDICLIENT_ERROR clientErr;  157   void setSdiSw12(enum SDI_SW12 s) {sw12=s;}  158    165   void setClientError(int libsdiprotocol_result);  166    167 public:  168   SdiBase() : sw12(0), additionalResultValue(0), clientErr(SDICLIENT_ERROR_NONE){}  169   enum SDI_SW12 getSdiSw12();  170    175   int getAdditionalResultValue(){return additionalResultValue;}  176    183   SDICLIENT_ERROR getClientError(){return clientErr;}  184    195   enum SDI_SW12 receiveSW12();  196    200   void clear()  201   {  202     sw12 = SDI_SW12_NONE;  203     additionalResultValue = 0;  204     clientErr = SDICLIENT_ERROR_NONE;  205   };  206    210   void importResults(const SdiBase& intermediate)  211   {  212     sw12 = intermediate.sw12;  213     additionalResultValue = intermediate.additionalResultValue;  214     clientErr = intermediate.clientErr;  215   }  216    217   struct PluginResult  218   {  219     int32_t pluginId;   220     int32_t responseCode;   223     std::vector<unsigned char> responseData;   225   };  226    227 private:  228   // make SdiBase non-copyable because some subclasses hold pointers and should not be copied  229   SdiBase(const SdiBase&);  230   SdiBase& operator=(const SdiBase&);  231   // since C++11 we have to avoid the move, too  232 #if __cplusplus >= 201103L  233   SdiBase(const SdiBase&&);  234   SdiBase& operator=(SdiBase&&);  235 #endif  236 };  237    238    239    265 class SdiCmd: public SdiBase  266 {  267 protected:  268   void* dataIn;   269   void* dataOut;   270    271 public:  272   SdiCmd();  273   virtual ~SdiCmd();  274    292   enum SDI_SW12 sendReceive(unsigned char cla, unsigned char ins,  293           unsigned char p1 = 0, unsigned char p2 = 0,  294           unsigned maxResponseSize = 2048);  295    308   int send(unsigned char cla, unsigned char ins,  309           unsigned char p1 = 0, unsigned char p2 = 0);  310    319   enum SDI_SW12 receive(unsigned maxResponseSize = 2048);  320    321   // generic setters modify #dataIn before command execution  334   void set(const char* path, int value, unsigned fixedLength = 0);  335    348   void set(const char* path, uint32_t value, unsigned fixedLength = 0);  349    360   void set(const char* path, const unsigned char* data, unsigned dataLen);  361    371   inline void set(const char* path, unsigned char byteValue)  372   {  373     set(path, &byteValue, 1);  374   }  375    385   void set(const char* path, const std::vector<unsigned char>& data);  386    396   void set(const char* path, const std::string& value);  397    406   void setCommandDestination(bool epp, bool force = false);  407    411   virtual void clear();  412    419   virtual void clear(const char* path);  420    424   virtual void clearResults();  425    433   void importResults(const SdiCmd& intermediate);  434    442   void importResults(const unsigned char* sw12, const unsigned char* tlvData, unsigned tlvSize);  443    444   // generic getter to read from dataOut after command execution  452   bool get(const char* path, int& value);  453    461   bool get(const char* path, uint32_t& value);  462    471   int get(const char* path, unsigned char* buffer, unsigned bufferSize);  472    480   inline bool get(const char* path, unsigned char& value)  481   {  482     return get(path, &value, 1) == 1;  483   }  484    492   bool get(const char* path, std::vector<unsigned char>& buffer);  493    501   bool get(const char* path, std::string& value);  502    509   std::string getString(const char* path);  510 };  511    512 class SDI: public SdiBase  513 {  514 public:  515    525   bool getDateTime(unsigned char* buffer);  526    536   bool setDateTime(const unsigned char* dateTime);  537    545   unsigned char getLanguage();  546    554   bool setLanguage(unsigned char languageId);  555    568   unsigned char getCardDataEntryDeactivation();  569    582   bool setCardDataEntryDeactivation(unsigned char value);  583    593   unsigned char getCardDataEntryMode();  594    604   bool setCardDataEntryMode(unsigned char value);  605    613   bool setIdleText(std::string text, bool epp = true);  614    623   bool showMacDesktop(bool epp = true);  624    635   int getProperty(enum vfisysinfo::SYSPropertyInt p, bool epp = false); // 20 1A 00 00  636    647   enum vfisysinfo::sysError getProperty(enum vfisysinfo::SYSPropertyInt p, int& value, bool epp = false); // 20 1A 00 00  648    659   enum vfisysinfo::sysError setProperty(enum vfisysinfo::SYSPropertyInt p, int value, bool epp = false); // 20 19 00 00  660    671   std::string getProperty(enum vfisysinfo::SYSPropertyString p, bool epp = false); // 20 1A 00 01  672    683   enum vfisysinfo::sysError getProperty(enum vfisysinfo::SYSPropertyString p, std::string& value, bool epp = false);  684    695   enum vfisysinfo::sysError setProperty(enum vfisysinfo::SYSPropertyString p, const std::string& value, bool epp = false); // 20 19 00 01  696    703   std::string getVersionInfo(bool epp = false);  704    711   bool checkForUpdate(unsigned char updateKind);  712    719   bool waitCardRemoval(unsigned seconds);  720    729   int sendWaitCardRemoval(unsigned seconds);  730    731   // Data Interface (without crypto handle)  732    736   void clearDataStore();  737    748   bool vclRegistartSRED(std::vector<unsigned char>& track1,  749           std::vector<unsigned char>& track2,  750           std::vector<unsigned char>& track3);  751    759   bool vclStatusRequest(std::vector<unsigned char>& vclStatus);  760    771   bool vclAdvanceDDK(std::vector<unsigned char>& track1,  772           std::vector<unsigned char>& track2,  773           std::vector<unsigned char>& track3);  774    786   bool vclRequestEParms(std::vector <unsigned char>& eParms);  787    798   std::string vclGetDiagnosticData(unsigned char format = 1,  799                                    unsigned char pageNumber = 0);  800    807   int vclGetKeyDerivationMode();  808    819   bool vclOverrideMessageQuery(std::vector<unsigned char>& track1,  820           std::vector<unsigned char>& track2,  821           std::vector<unsigned char>& track3);  822    831   bool vclKsnRequest(std::string& ksn);  832    840   bool vclKmailinRequest();  841    852   libsdi::SDI_SW12 pluginCommand(const unsigned char plugin, const unsigned char cmd,  853                                  const std::vector<unsigned char>& data,  854                                  std::vector<unsigned char>& response);  855    865   bool setManualPAN(const std::vector<unsigned char>& pan);  866    876   bool setManualPAN(const std::string& pan);  877    891   libsdi::SDI_SW12 performValidationChecks(std::vector<MatchingRecord>& records,  892                                            const std::vector<unsigned char>& currentDate,  893                                            const unsigned char options = 0,  894                                            const std::vector<unsigned char> IIN = std::vector<unsigned char>());  895    903   libsdi::SDI_SW12 getValidationInfo(std::string& info);  904    914   libsdi::SDI_SW12 sysUploadStart(const std::string& filename,  915                                   SYSUploadType type,  916                                   bool epp = false);  917    926   libsdi::SDI_SW12 sysUploadTransfer(const std::vector<unsigned char>& packet,  927                                      unsigned packet_no,  928                                      bool epp = false);  929    941   libsdi::SDI_SW12 sysUploadFinalize(const std::vector<unsigned char>* md5 = NULL,  942                                      const std::vector<unsigned char>* mac = NULL,  943                                      bool epp = false);  944    951   bool sysShutdown(bool epp = false);  952    959   bool sysReboot(bool epp = false);  960    968   bool sysSleep(bool epp = false);  969    977   bool sysHybernate(bool epp = false);  978    984   bool installSponsorCert(const std::vector<unsigned char>& cert);  985    995   bool getLastInstallError(std::string& json, std::string& bundle, std::string& package, bool epp = false);  996    997   1002   void externalButton(void); 1003   1016   bool enableEpp(int& status); 1017   1030   bool disableEpp(int& status); 1031   1036   bool factoryReset(); 1037   1044   bool readCertificate(const std::string& name, std::vector<unsigned char>& certificate); 1045   1052   bool setUseCurrencyAbbreviation(const unsigned char* currency, bool useAbbreviation); 1053   1060   bool setUseCurrencyAbbreviation(unsigned currency, bool useAbbreviation); 1061   1071   bool msrSwitchLeds(int led1, int led2, int led3, int duration); 1072   1079   bool msrSetSensitivty(unsigned char level, bool epp = false); 1080   1081   1091   enum vfiprt::PrtError setPrinterProperty(enum vfiprt::PrtPropertyInt p, int value); // 25 00 00 00 1092   1102   enum vfiprt::PrtError setPrinterProperty(enum vfiprt::PrtPropertyString p, const std::string& value); // 25 00 00 01 1103   1113   enum vfiprt::PrtError getPrinterProperty(enum vfiprt::PrtPropertyInt p, int& value); // 25 01 00 00 1114   1124   enum vfiprt::PrtError getPrinterProperty(enum vfiprt::PrtPropertyString p, std::string& value); // 25 01 00 01 1125   1133   enum vfiprt::PrtError printHtml(const std::string& html, bool landscape = false); 1134   1143   enum vfiprt::PrtError printBitmap(const int width, const int height, const std::vector<unsigned char>& data); 1144   1145 private: 1146   bool sysPower(unsigned char p2, bool epp); 1147   bool enableEpp(int& status, unsigned char p2); 1148   1149 }; // class SDI 1150   1151   1170 class CardDetection: public SdiCmd 1171 { 1172 public: 1173   const static unsigned char SDI_TEC_CHIP = 1; // ISO 7816 1174   const static unsigned char SDI_TEC_MAGN = 2; // ISO 7810 1175   const static unsigned char SDI_TEC_CTLS = 4; // ISO 14443 1176   const static unsigned char SDI_TEC_MANU = 8; // ITU-T E.161 1177   1182   enum DetectionMode { 1183     DETECTION_MODE_BLOCKING,  1184     DETECTION_MODE_POLLING,   1185     DETECTION_MODE_CALLBACK   1186   }; 1187   1193   void setDetectionMode(const enum DetectionMode mode); 1194   1200   void setTecStartOptions(const std::vector<unsigned char>& opts); // see cts_StartSelection 1201   1207   void setTecConfig(const std::vector<unsigned char>& opts); // see cts_SetOptions 1208   1214   void setCancelButton(bool enable); 1215   1221   void setCardEntryValueDeativation(unsigned char b); 1222   1228   void setAlternativeInputFormat(const char* f); 1229   1240   void setCardRemovalTimeout(unsigned timeout_ms); 1241   1248   void setCallback(void (*cb)(unsigned char technology, void* context), void* ctx); 1249   1250   1257   void cardDetectedCallback(unsigned char *dataIn, unsigned short sizeIn); 1258   1259   1290   int startSelection(unsigned char supportedTechnologies, unsigned seconds); 1291   1301   enum libsdi::SDI_SW12 stopSelection(); 1302   1340   unsigned char receiveTechnology(); 1341   1350   bool cardReadAtEpp(); 1351   1360   unsigned char pollTechnology(); 1361   1369   enum libsdi::SDI_SW12 addTechnology(unsigned char technology, const std::vector<unsigned char>& opts); 1370   1377   enum libsdi::SDI_SW12 removeTechnology(unsigned char technology); 1378   1383   std::string getPan(); 1384   1389   std::string getTrack2(); 1390   1396   int getTrack2Bin(std::vector<unsigned char>& data); 1397   1402   std::string getCardholderName(); 1403   1408   std::string getServiceCode(); 1409   1414   std::string getTrack1(); 1415   1424   int getPluginResponseData(std::vector<unsigned char>& data); 1425   1439   int getPluginResponseData(unsigned index, 1440           int32_t& pluginId, 1441           int32_t& pluginResponseCode, 1442           std::vector<unsigned char>& data); 1443   1450   bool getPluginResponseData(std::vector<PluginResult>& results); 1451   1458   std::string getString(unsigned CTS_DATA_TAG); 1459   1475   unsigned char getValue(unsigned CTS_DATA_TAG, unsigned char defaultValue); 1476   1484   unsigned char getValue(unsigned CTS_DATA_TAG, int n, unsigned char defaultValue); 1485   1491   int getData(std::vector<unsigned char>& data); 1492   1500   int getData(unsigned CTS_DATA_TAG, std::vector<unsigned char>& data); 1501   1511   int getData(unsigned CTS_DATA_TAG, int n, std::vector<unsigned char>& data); 1512   1521   int getTecselData(std::vector<unsigned char>& data); 1522   1537   int startMsrRead(unsigned timeout_sec); 1538   1562   int msrSetOptions(const std::vector<unsigned char>& opts); 1563   1572   int msrGetTrackStatus(int track); 1573   1580   int msrGetCardSpecificToken(std::vector<unsigned char>& token); 1581   1582   CardDetection(); 1583   ~CardDetection(); 1584   1592   virtual void clear(); 1593   1594 private: 1595   void (*callback)(unsigned char technology, void* context); 1596   void* context; 1597   enum DetectionMode mode; 1598 }; 1599   1603 class PED: public SdiCmd 1604 { 1605 public: 1609   enum NavigatorMode 1610   { 1611     NAVIGATOR_MODE_OFF,  1612     NAVIGATOR_MODE_DOUBLE_TAB,  1613     NAVIGATOR_MODE_TACTILE_BUTTON  1614   }; 1615   1624   void setTimeout(unsigned seconds); 1625   1633   bool setDefaultTimeout(unsigned seconds); 1634   1650   void setTouchCoordinates(const unsigned char* array, unsigned size); 1651   1656   void setNavigatorMode(enum NavigatorMode mode); 1657   1668   void setPinDigitCountMinMax(unsigned char min, unsigned char max); 1669   1676   void setLanguage(unsigned char lang); 1677   1684   void setAmount(const unsigned char* amount); 1685   1692   void setCurrency(const unsigned char* currency); 1693   1701   void setAppLabel(const std::string& appLabel); 1702   1703   1730   int startPinInput(); 1731   1742   int startPinInput(bool enablePinBypass); 1743   1763   bool startPinEntry(unsigned pinBypassKey = 0); 1764   1771   bool pollPinEntry(std::vector<unsigned char>& status); 1772   1778   bool stopPinEntry(); 1779   1788   bool setPinInputClearKeyMode(bool clearAllDigits); 1789   1796   void setClearKeyMode(bool clearAllDigits); 1797   1804   void setPinBypassKeyAndMode(unsigned char value); 1805   1812   void setAutoConfirmation(bool enable); 1813   1820   void setDialogOptions(uint32_t options); 1821   1828   void setIntercharTimeout(uint32_t millis); 1829   1838   void setHeaderLabel(const std::string& label); 1839   1846   void setEchoChar(uint32_t unicode); 1847   1866   bool sendPinInputParameters(bool epp = true); 1867   1874   enum SDI_SW12 receiveGetPinResult(); 1875   1884   bool getPinBypassKey(unsigned char& value); 1885 }; 1886   1895 class SdiCrypt: public SdiBase 1896 { 1897 public: 1898   // SDI Crypto Interface 1899   SdiCrypt(); 1900   ~SdiCrypt(); 1901   1910   bool open(const char* hostName); 1911   1918   bool close(); 1919   1925   bool isOpen() const; 1926   1933   uint32_t getCryptoHandle(); 1934   1946   bool encrypt(const std::vector<unsigned char>& data, 1947           std::vector<unsigned char>& encrypted); 1948   1960   bool decrypt(const std::vector<unsigned char>& encrypted, 1961           std::vector<unsigned char>& decrypted); 1962   1974   bool sign(const std::vector<unsigned char>& data, 1975           std::vector<unsigned char>& signature); 1976   1988   bool verify(const std::vector<unsigned char>& data, 1989           const std::vector<unsigned char>& signature); 1990   2005   bool updateKey(unsigned char keyType, const std::vector<unsigned char>& keyData, 2006           std::vector<unsigned char>* proprietaryData = NULL, 2007           const unsigned char AS2805 = 0, 2008           std::vector<unsigned char>* KCV = NULL); 2009   2021   bool setKeySetId(uint32_t ksid, uint32_t mksid = 0, bool asAttribute = false); 2022   2031   bool getEncryptedPin(unsigned char pinBlockFormat, 2032           std::vector<unsigned char>& pinBlock, 2033           bool requestZeroPinBlock = false); 2034   2040   std::string getKeyInventory(); 2041   2050   bool getKeyData(unsigned char keyType, std::vector<unsigned char>& keyData, unsigned char kekFlag = 0); 2051   2058   std::string getStatus(); 2059   2069   std::string getStatus(std::string hostName); 2070   2071   2078   static std::string getVersions(int& additionalResult); 2079   2090   void setInitialVector(const std::vector<unsigned char>& iv) 2091   { 2092     initialVector = iv; 2093   } 2094   2100   void getInitialVector(std::vector<unsigned char>& iv) const 2101   { 2102     iv = initialVector; 2103   } 2104   2105   2111   void getKeySerialNumber(std::vector<unsigned char>& ksn) const 2112   { 2113     ksn = keySerialNumber; 2114   } 2115   2119   struct Placeholder 2120   { 2121     std::vector<unsigned char> tagList;           2122     std::vector<unsigned char> applicationData;   2123     std::vector<unsigned char> dataOptions;       2124   }; 2125   2140   bool getEncData(const Placeholder& descriptor, 2141           std::vector<unsigned char>& encrypted, 2142           bool useStoredData = false, 2143           bool incrementKSN = false); 2144   2160   bool getEncMsgData(const std::vector<unsigned char>& messageTemplate, 2161           const std::vector<Placeholder>& placeholder, 2162           std::vector<unsigned char>& encrypted, 2163           bool useStoredData = false, 2164           bool incrementKSN = false); 2165   2181   bool getMsgSignature(const std::vector<unsigned char>& messageTemplate, 2182           const std::vector<Placeholder>& placeholder, 2183           std::vector<unsigned char>& signature, 2184           bool useStoredData = false, 2185           bool incrementKSN = false); 2186   2194   bool getEncTrxData(const std::vector<unsigned long> tags, std::vector<unsigned char>& data); 2195   2202   bool setEncTrxData(const std::vector<unsigned char> data); 2203   2209   bool endEncTrxData(); 2210   2211 private: 2212   unsigned char cryptoHandle[4]; 2213   std::vector<unsigned char> initialVector; 2214   std::vector<unsigned char> keySerialNumber; 2215   uint32_t keySetId; 2216   uint32_t masterKeySetId; 2217 }; 2218   2228 class ManualEntry: public SdiCmd 2229 { 2230 public: 2231   ManualEntry(); 2232   ~ManualEntry(); 2233   2240   void setLanguage(unsigned char language); 2241   2242   2249   int setTimeout(unsigned seconds); 2250   2264   int setCvvEntryDeactivation(unsigned char cvvEntry); 2265   2266   2275   int setCardDataEntryMode(unsigned char mode); 2276   2277   2284   int setCvvInputString(const std::string &inputString); 2285   2301   int setTouchCoordinates(const unsigned char* array, unsigned size); 2302   2312   int setMimimumDigits(unsigned char minimumDigits); 2313   2322   int setDoubleConfirmationMode(unsigned char mode); 2323   2344   int start(); 2345   2362   int receiveResult(std::string& obfuscatedPAN, std::vector<unsigned char>& token); 2363   2372   int getPluginResponseData(std::vector<unsigned char>& data); 2373   2387   int getPluginResponseData(unsigned index, 2388           int32_t& pluginId, 2389           int32_t& pluginResponseCode, 2390           std::vector<unsigned char>& data); 2391   2398   bool getPluginResponseData(std::vector<PluginResult>& results); 2399 }; 2400   2446 class Dialog: public SdiCmd 2447 { 2448 public: 2449   2456   2462   const static int DIALOG_SUCCESS = 0; 2463   2469   const static int DIALOG_CANCEL_PRESSED = -1; 2470   2476   const static int DIALOG_TIMEOUT = -3; 2477   2484   const static int DIALOG_SYS_ABORT = -8; 2485   2491   const static int DIALOG_CLIENT_ERROR = -14; 2492   2498   const static int DIALOG_SDI_SW12 = -15; 2499   2504   const static int DIALOG_NO_ASYNC_DIALOG = 1; 2505   2510   const static int DIALOG_IN_PROGRESS = 2; 2511   2513   2520   const static unsigned DLG_DisplayOnly       = 0x00000000; 2521   const static unsigned DLG_CancelKey         = 0x00000002; 2522   const static unsigned DLG_ClearKey          = 0x00000004; 2523   const static unsigned DLG_EnterKey          = 0x00000008; 2524   const static unsigned DLG_NoLEDs            = 0x00000010; 2525   const static unsigned DLG_CtlsLogo          = 0x00000020; 2526   const static unsigned DLG_QuestionLogo      = 0x00000040; 2527   const static unsigned DLG_WarningLogo       = 0x00000080; 2528   const static unsigned DLG_ErrorLogo         = 0x00000100; 2529   const static unsigned DLG_SuccessLogo       = 0x00000200; 2530   const static unsigned DLG_WaitLogo          = 0x00000400; 2531   const static unsigned DLG_Async             = 0x00000800; 2532   const static unsigned DLG_StoreAsyncResult  = 0x00001000; 2533   const static unsigned DLG_HideSoftKeys      = 0x00002000; 2534   const static unsigned DLG_TextAlignLeft     = 0x00004000; 2535   const static unsigned DLG_TextAlignRight    = 0x00008000; 2536   const static unsigned DLG_TextAlignTop      = 0x00010000; 2537   const static unsigned DLG_TextAlignButton   = 0x00020000; 2538   const static unsigned DLG_NoHeader          = 0x00040000; 2539   const static unsigned DLG_ClearOnReturn     = 0x00100000; 2540   const static unsigned DLG_AbortOnCardRemove = 0x00200000; 2541   const static unsigned DLG_IgnoreExtAbort    = 0x00400000; 2543   2550   const static unsigned MENU_NoOpts           = 0x00000000; 2551   const static unsigned MENU_NoLEDs           = 0x00000002; 2552   const static unsigned MENU_ClearOnReturn    = 0x00000004; 2553   const static unsigned MENU_AbortOnCardRemove= 0x00000008; 2554   const static unsigned MENU_IgnoreExtAbort   = 0x00000010; 2555   const static unsigned MENU_NoHeader         = 0x00000020; 2557   2561   enum REQUEST_CARD_MODE 2562   { 2563     REQUEST_CARD_STANDARD = 0,  2564     REQUEST_CARD_FALLBACK = 1,  2565     REQUEST_CARD_RETRY    = 2   2566   }; 2567   2576   bool clearScreen(bool epp = true); 2577   2601   int display(const std::string& text, bool epp = true); 2602   2626   int secureInput(bool epp = true); 2627   2659   int menu(bool epp = true); 2660   2678   int requestCard(unsigned char technology, 2679           enum REQUEST_CARD_MODE mode = REQUEST_CARD_STANDARD, 2680           bool epp = true); 2681   2688   bool idleScreen(bool epp = true); 2689   2705   int captureSignature(std::vector<unsigned char>& signature, std::string& format, 2706           bool epp = true); 2707   2714   static void showLedArea(bool show); 2715   2737   int htmlDialog(const std::string& fname, bool epp = true); 2738   2750   int getAsyncResult(bool epp = true); 2751   2755   static void abort(); 2756   2765   void setTemplate(unsigned char id); 2766   2775   void setInputTemplate(unsigned char id); 2776   2786   void setLanguage(unsigned char language); 2787   2799   void addData(const std::string& name, const std::string& value); 2800   2811   void setTimeout(int seconds); 2812   2825   void setOptions(unsigned options); 2826   2836   void setEnterKeyLabel(const std::string& label); 2837   2847   void setClearKeyLabel(const std::string& label); 2848   2858   void setCancelKeyLabel(const std::string& label); 2859   2869   void setUpKeyLabel(const std::string& label); 2870   2879   void setDownKeyLabel(const std::string& label); 2880   2889   void setHeader(const std::string& text); 2890   2899   void setBeep(bool active = true); 2900   2910   void addAction(const std::string& key, const std::string& action); 2911   2920   void setMaskingCharacter(char c); 2921   2930   void setAlternativeInputFormat(const char* f); 2931   2940   void setAmount(const unsigned char* amount); 2941   2952   void setCurrency(const unsigned char* currency); 2953   2964   void setTransactionType(unsigned char txnType); 2965   2974   void setMenuText(const std::string& text); 2975   2984   void addMenuItem(const std::string& item); 2985   2996   void setPreSelected(unsigned char itemNumber); 2997   3012   void setAdminMenu(unsigned char adminMenu); 3013   3022   unsigned char getSelected(); 3023   3033   std::string get(const std::string& name); 3034   3047   std::vector<std::string> getInputFieldNames(); 3048   3049 private: 3050   int startDialog(unsigned char instruction, bool epp); 3051 }; 3052   3053 } // namespace sdi 3054   3055 #ifndef DOXYGEN 3056 #endif // C++ 3057 #endif 3058 #endif /* CLIENT_SDI_IF_H_ */

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo