Skip to main content

Application Development Kit (Version 4.8)


sdi_if.h

Last updated: 02-Oct-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_NO_MSR_DATA = 0x64F6,    37   SDI_SW12_TIMEOUT_CARD_REMOVAL = 0x64F7,    38   SDI_SW12_INTERCHAR_PIN_ENTRY = 0x64F8,    39   SDI_SW12_COMMAND_NOT_ALLOWED = 0x64F9,    40   SDI_SW12_MAIN_CONNECTION_USED = 0x64FA,    41   SDI_SW12_INVALID_FILE_CONTENT = 0x64FB,    42   SDI_SW12_FILE_ACCESS_ERROR = 0x64FC,    43   SDI_SW12_LOGIC_ERROR = 0x64FD,    44   SDI_SW12_SDI_PARAMETER_ERROR = 0x64FE,    45   SDI_SW12_LUHN_CHECK_FAILED = 0x64FF,    46   SDI_SW12_EXECUTION_ABORTED = 0x6500,    47   SDI_SW12_EXECUTION_TIMEOUT = 0x6600,    48   SDI_SW12_MESSAGE_LENGTH_ERROR = 0x6700,    49     50   SDI_SW12_NO_SDI_PLUGIN_AVAILABLE = 0x6800,    51   SDI_SW12_UNKNOWN_PLUGIN_ID = 0x6801,    52   SDI_SW12_UNKNOWN_PLUGING_ID = 0x6801,    53   SDI_SW12_INVALID_PLUGIN_RESPONSE = 0x6802,    54     55   SDI_SW12_EPP_CONNECTION_ERROR = 0x6900,    56     57   SDI_SW12_UNKNOWN_INS_BYTE = 0x6D00,    58   SDI_SW12_UNKNOWN_CLA_BYTE = 0x6E00,    59     60   SDI_SW12_CMAC_ERROR = 0x6FB0,    61   SDI_SW12_CMAC_LENGTH_ERROR = 0x6FB1,    62   SDI_SW12_CMAC_MISSING_ERROR = 0x6FB2,    63   SDI_SW12_ENCRYPTION_ERROR = 0x6FB4,    64   SDI_SW12_ENCRYPTION_LENGTH_ERROR = 0x6FB5,    65   SDI_SW12_ENCRYPTION_MISSING_ERROR = 0x6FB6,    66   SDI_SW12_DECRYPTION_ERROR = 0x6FB8,    67   SDI_SW12_DECRYPTION_LENGTH_ERROR = 0x6FB9,    68   SDI_SW12_DECRYPTION_MISSING_ERROR = 0x6FBA,    69     70   SDI_SW12_EXCESSIVE_PIN_REQUESTS = 0x6FC0,    71   SDI_SW12_LOW_BATTERY = 0x6FD0,    72   SDI_SW12_NO_DUKPT_KEYS_LOADED = 0x6FE0,    73   SDI_SW12_UNIT_TAMPERED = 0x6FF0,    74   SDI_SW12_RECOVERY_MODE = 0x6FF1,    75     76   SDI_SW12_PIN_BYPASSED = 0x9070,    77   SDI_SW12_NO_MACTCH_FOR_CARD_VALIDATION = 0x9071,    78   SDI_SW12_SMART_CARD_REMOVED = 0x9401,    79   SDI_SW12_SMART_CARD_ERROR_TRM = 0x9402,    80   SDI_SW12_SMART_CARD_ERROR = 0x9403,    81   SDI_SW12_TWO_CARDS = 0x9404,    82   SDI_SW12_SMART_CARD_ERR_INIT = 0x9405,    83   SDI_SW12_SMART_CARD_ERR_PARAM = 0x9406,    84   SDI_SW12_EMV_TLV_ERROR = 0x94F3, // error In TLV data object (only in relation with EMV commands)   85     86   // There are from previous header version and kept for backward compatibility   87   SDI_SW12_ERROR = 0x6400,    88   SDI_SW12_TIMEOUT = 0x6600,    89   SDI_SW12_NOT_ALLOWED = 0x64FD,    90   SDI_SW12_PARAMETER_ERROR = 0x90E6    91 };   92    100 enum SDICLIENT_ERROR  101 {  102   SDICLIENT_ERROR_NONE = 0,             103   SDICLIENT_ERROR_COMMUNICATION = -1,   104   SDICLIENT_ERROR_CONCURRENT_USE = -2,  105   SDICLIENT_ERROR_CONNECT = -3,         106   SDICLIENT_ERROR_OVERFLOW = -4,        107   SDICLIENT_ERROR_PARAM = -5,           108   SDICLIENT_ERROR_OTHER = -6,           109   SDICLIENT_ERROR_NO_RECEIVE = -7,      110   SDICLIENT_ERROR_NOT_SUPPORTED = -10,  112   SDICLIENT_ERROR_NOT_ALLOWED = -11     113 };  114    115 #define MSR_CLIENT_ERROR_OFFSET   100   116    117 #define VALIDATION_CHECK_OPTION_RETURN_ALL_MATCHING_RANGES       0x01  //Return all matching card ranges. per default only the best match is returned  118    122 enum SDICLIENT_ERROR getNfcClientError();  123    127 enum SDI_SW12 getNfcSW12();  128    129 struct MatchingRecord  130 {  131   std::string json;  132   unsigned char expirycheck_result;  133   unsigned char luhncheck_result;  134   unsigned char activationcheck_result;  135   MatchingRecord(const std::string &_json): json(_json), expirycheck_result(0xFF), luhncheck_result(0xFF), activationcheck_result(0xFF){};  136 };  137    139 enum SYSUploadType  140 {  141   SYS_UPLOAD_SOFTWARE_UPDATE       =  0,   142   SYS_UPLOAD_CONFIG_WHITELIST      =  1,   143   SYS_UPLOAD_CONFIG_SENSITIVE_TAGS =  2,   144   SYS_UPLOAD_CONFIG_CARD_RANGES    =  3,   145   SYS_UPLOAD_INSTALL_CP_PACKAGE    = 11,   146   SYS_UPLOAD_EMV_CONFIGURATION     = 12,   147   SYS_UPLOAD_UVRK_PACKAGE          = 13,   148 };  149    150    154 class SdiBase  155 {  156 protected:  157   unsigned short sw12;  158   int additionalResultValue;  159   SDICLIENT_ERROR clientErr;  160   void setSdiSw12(enum SDI_SW12 s) {sw12=s;}  161    168   void setClientError(int libsdiprotocol_result);  169    170 public:  171   SdiBase() : sw12(0), additionalResultValue(0), clientErr(SDICLIENT_ERROR_NONE){}  172   enum SDI_SW12 getSdiSw12();  173    178   int getAdditionalResultValue(){return additionalResultValue;}  179    186   SDICLIENT_ERROR getClientError(){return clientErr;}  187    198   enum SDI_SW12 receiveSW12();  199    203   void clear()  204   {  205     sw12 = SDI_SW12_NONE;  206     additionalResultValue = 0;  207     clientErr = SDICLIENT_ERROR_NONE;  208   };  209    213   void importResults(const SdiBase& intermediate)  214   {  215     sw12 = intermediate.sw12;  216     additionalResultValue = intermediate.additionalResultValue;  217     clientErr = intermediate.clientErr;  218   }  219    220   struct PluginResult  221   {  222     int32_t pluginId;   223     int32_t responseCode;   226     std::vector<unsigned char> responseData;   228   };  229    230 private:  231   // make SdiBase non-copyable because some subclasses hold pointers and should not be copied  232   SdiBase(const SdiBase&);  233   SdiBase& operator=(const SdiBase&);  234   // since C++11 we have to avoid the move, too  235 #if __cplusplus >= 201103L  236   SdiBase(const SdiBase&&);  237   SdiBase& operator=(SdiBase&&);  238 #endif  239 };  240    241    242    268 class SdiCmd: public SdiBase  269 {  270 protected:  271   void* dataIn;   272   void* dataOut;   273    274 public:  275   SdiCmd();  276   virtual ~SdiCmd();  277    295   enum SDI_SW12 sendReceive(unsigned char cla, unsigned char ins,  296           unsigned char p1 = 0, unsigned char p2 = 0,  297           unsigned maxResponseSize = 2048);  298    311   int send(unsigned char cla, unsigned char ins,  312           unsigned char p1 = 0, unsigned char p2 = 0);  313    322   enum SDI_SW12 receive(unsigned maxResponseSize = 2048);  323    324   // generic setters modify #dataIn before command execution  337   void set(const char* path, int value, unsigned fixedLength = 0);  338    351   void set(const char* path, uint32_t value, unsigned fixedLength = 0);  352    363   void set(const char* path, const unsigned char* data, unsigned dataLen);  364    374   inline void set(const char* path, unsigned char byteValue)  375   {  376     set(path, &byteValue, 1);  377   }  378    388   void set(const char* path, const std::vector<unsigned char>& data);  389    399   void set(const char* path, const std::string& value);  400    409   void setCommandDestination(bool epp, bool force = false);  410    414   virtual void clear();  415    422   virtual void clear(const char* path);  423    427   virtual void clearResults();  428    436   void importResults(const SdiCmd& intermediate);  437    445   void importResults(const unsigned char* sw12, const unsigned char* tlvData, unsigned tlvSize);  446    447   // generic getter to read from dataOut after command execution  455   bool get(const char* path, int& value);  456    464   bool get(const char* path, uint32_t& value);  465    474   int get(const char* path, unsigned char* buffer, unsigned bufferSize);  475    483   inline bool get(const char* path, unsigned char& value)  484   {  485     return get(path, &value, 1) == 1;  486   }  487    495   bool get(const char* path, std::vector<unsigned char>& buffer);  496    504   bool get(const char* path, std::string& value);  505    512   std::string getString(const char* path);  513 };  514    515 class SDI: public SdiBase  516 {  517 public:  518    528   bool getDateTime(unsigned char* buffer);  529    539   bool setDateTime(const unsigned char* dateTime);  540    548   unsigned char getLanguage();  549    557   bool setLanguage(unsigned char languageId);  558    571   unsigned char getCardDataEntryDeactivation();  572    585   bool setCardDataEntryDeactivation(unsigned char value);  586    596   unsigned char getCardDataEntryMode();  597    607   bool setCardDataEntryMode(unsigned char value);  608    616   bool setIdleText(std::string text, bool epp = true);  617    626   bool showMacDesktop(bool epp = true);  627    638   int getProperty(enum vfisysinfo::SYSPropertyInt p, bool epp = false); // 20 1A 00 00  639    650   enum vfisysinfo::sysError getProperty(enum vfisysinfo::SYSPropertyInt p, int& value, bool epp = false); // 20 1A 00 00  651    662   enum vfisysinfo::sysError setProperty(enum vfisysinfo::SYSPropertyInt p, int value, bool epp = false); // 20 19 00 00  663    674   std::string getProperty(enum vfisysinfo::SYSPropertyString p, bool epp = false); // 20 1A 00 01  675    686   enum vfisysinfo::sysError getProperty(enum vfisysinfo::SYSPropertyString p, std::string& value, bool epp = false);  687    698   enum vfisysinfo::sysError setProperty(enum vfisysinfo::SYSPropertyString p, const std::string& value, bool epp = false); // 20 19 00 01  699    706   std::string getVersionInfo(bool epp = false);  707    714   bool checkForUpdate(unsigned char updateKind);  715    722   bool waitCardRemoval(unsigned seconds);  723    732   int sendWaitCardRemoval(unsigned seconds);  733    734   // Data Interface (without crypto handle)  735    739   void clearDataStore();  740    751   bool vclRegistartSRED(std::vector<unsigned char>& track1,  752           std::vector<unsigned char>& track2,  753           std::vector<unsigned char>& track3);  754    762   bool vclStatusRequest(std::vector<unsigned char>& vclStatus);  763    774   bool vclAdvanceDDK(std::vector<unsigned char>& track1,  775           std::vector<unsigned char>& track2,  776           std::vector<unsigned char>& track3);  777    789   bool vclRequestEParms(std::vector <unsigned char>& eParms);  790    801   std::string vclGetDiagnosticData(unsigned char format = 1,  802                                    unsigned char pageNumber = 0);  803    810   int vclGetKeyDerivationMode();  811    822   bool vclOverrideMessageQuery(std::vector<unsigned char>& track1,  823           std::vector<unsigned char>& track2,  824           std::vector<unsigned char>& track3);  825    834   bool vclKsnRequest(std::string& ksn);  835    843   bool vclKmailinRequest();  844    855   libsdi::SDI_SW12 pluginCommand(const unsigned char plugin, const unsigned char cmd,  856                                  const std::vector<unsigned char>& data,  857                                  std::vector<unsigned char>& response);  858    868   bool setManualPAN(const std::vector<unsigned char>& pan);  869    879   bool setManualPAN(const std::string& pan);  880    894   libsdi::SDI_SW12 performValidationChecks(std::vector<MatchingRecord>& records,  895                                            const std::vector<unsigned char>& currentDate,  896                                            const unsigned char options = 0,  897                                            const std::vector<unsigned char> IIN = std::vector<unsigned char>());  898    906   libsdi::SDI_SW12 getValidationInfo(std::string& info);  907    917   bool sysRegisterLoggingCallback(void (*logCallback)(const char*, void*),  918       void* context,  919       unsigned char options = 0);  920    930   libsdi::SDI_SW12 sysUploadStart(const std::string& filename,  931                                   SYSUploadType type,  932                                   bool epp = false);  933    942   libsdi::SDI_SW12 sysUploadTransfer(const std::vector<unsigned char>& packet,  943                                      unsigned packet_no,  944                                      bool epp = false);  945    957   libsdi::SDI_SW12 sysUploadFinalize(const std::vector<unsigned char>* md5 = NULL,  958                                      const std::vector<unsigned char>* mac = NULL,  959                                      bool epp = false);  960    967   bool sysShutdown(bool epp = false);  968    975   bool sysReboot(bool epp = false);  976    984   bool sysSleep(bool epp = false);  985    993   bool sysHybernate(bool epp = false);  994   1000   bool installSponsorCert(const std::vector<unsigned char>& cert); 1001   1011   bool getLastInstallError(std::string& json, std::string& bundle, std::string& package, bool epp = false); 1012   1013   1018   void externalButton(void); 1019   1032   bool enableEpp(int& status); 1033   1046   bool disableEpp(int& status); 1047   1052   bool factoryReset(); 1053   1060   bool readCertificate(const std::string& name, std::vector<unsigned char>& certificate); 1061   1068   bool setUseCurrencyAbbreviation(const unsigned char* currency, bool useAbbreviation); 1069   1076   bool setUseCurrencyAbbreviation(unsigned currency, bool useAbbreviation); 1077   1087   bool msrSwitchLeds(int led1, int led2, int led3, int duration); 1088   1095   bool msrSetSensitivty(unsigned char level, bool epp = false); 1096   1097   1107   enum vfiprt::PrtError setPrinterProperty(enum vfiprt::PrtPropertyInt p, int value); // 25 00 00 00 1108   1118   enum vfiprt::PrtError setPrinterProperty(enum vfiprt::PrtPropertyString p, const std::string& value); // 25 00 00 01 1119   1129   enum vfiprt::PrtError getPrinterProperty(enum vfiprt::PrtPropertyInt p, int& value); // 25 01 00 00 1130   1140   enum vfiprt::PrtError getPrinterProperty(enum vfiprt::PrtPropertyString p, std::string& value); // 25 01 00 01 1141   1149   enum vfiprt::PrtError printHtml(const std::string& html, bool landscape = false); 1150   1159   enum vfiprt::PrtError printBitmap(const int width, const int height, const std::vector<unsigned char>& data); 1160   1161 private: 1162   bool sysPower(unsigned char p2, bool epp); 1163   bool enableEpp(int& status, unsigned char p2); 1164   1165 }; // class SDI 1166   1167   1186 class CardDetection: public SdiCmd 1187 { 1188 public: 1189   const static unsigned char SDI_TEC_CHIP = 1; // ISO 7816 1190   const static unsigned char SDI_TEC_MAGN = 2; // ISO 7810 1191   const static unsigned char SDI_TEC_CTLS = 4; // ISO 14443 1192   const static unsigned char SDI_TEC_MANU = 8; // ITU-T E.161 1193   1198   enum DetectionMode { 1199     DETECTION_MODE_BLOCKING,  1200     DETECTION_MODE_POLLING,   1201     DETECTION_MODE_CALLBACK   1202   }; 1203   1209   void setDetectionMode(const enum DetectionMode mode); 1210   1216   void setTecStartOptions(const std::vector<unsigned char>& opts); // see cts_StartSelection 1217   1223   void setTecConfig(const std::vector<unsigned char>& opts); // see cts_SetOptions 1224   1230   void setCancelButton(bool enable); 1231   1237   void setCardEntryValueDeativation(unsigned char b); 1238   1244   void setAlternativeInputFormat(const char* f); 1245   1256   void setCardRemovalTimeout(unsigned timeout_ms); 1257   1264   void setCallback(void (*cb)(unsigned char technology, void* context), void* ctx); 1265   1266   1273   void cardDetectedCallback(unsigned char *dataIn, unsigned short sizeIn); 1274   1275   1306   int startSelection(unsigned char supportedTechnologies, unsigned seconds); 1307   1324   enum libsdi::SDI_SW12 stopSelection(); 1325   1363   unsigned char receiveTechnology(); 1364   1373   bool cardReadAtEpp(); 1374   1383   unsigned char pollTechnology(); 1384   1392   enum libsdi::SDI_SW12 addTechnology(unsigned char technology, const std::vector<unsigned char>& opts); 1393   1400   enum libsdi::SDI_SW12 removeTechnology(unsigned char technology); 1401   1406   std::string getPan(); 1407   1412   std::string getTrack2(); 1413   1419   int getTrack2Bin(std::vector<unsigned char>& data); 1420   1425   std::string getCardholderName(); 1426   1431   std::string getServiceCode(); 1432   1437   std::string getTrack1(); 1438   1447   int getPluginResponseData(std::vector<unsigned char>& data); 1448   1462   int getPluginResponseData(unsigned index, 1463           int32_t& pluginId, 1464           int32_t& pluginResponseCode, 1465           std::vector<unsigned char>& data); 1466   1473   bool getPluginResponseData(std::vector<PluginResult>& results); 1474   1481   std::string getString(unsigned CTS_DATA_TAG); 1482   1498   unsigned char getValue(unsigned CTS_DATA_TAG, unsigned char defaultValue); 1499   1507   unsigned char getValue(unsigned CTS_DATA_TAG, int n, unsigned char defaultValue); 1508   1514   int getData(std::vector<unsigned char>& data); 1515   1523   int getData(unsigned CTS_DATA_TAG, std::vector<unsigned char>& data); 1524   1534   int getData(unsigned CTS_DATA_TAG, int n, std::vector<unsigned char>& data); 1535   1544   int getTecselData(std::vector<unsigned char>& data); 1545   1560   int startMsrRead(unsigned timeout_sec); 1561   1573   int msrSetOptions(const std::vector<unsigned char>& opts); 1574   1583   int msrGetTrackStatus(int track); 1584   1591   int msrGetCardSpecificToken(std::vector<unsigned char>& token); 1592   1593   CardDetection(); 1594   ~CardDetection(); 1595   1603   virtual void clear(); 1604   1605 private: 1606   void (*callback)(unsigned char technology, void* context); 1607   void* context; 1608   enum DetectionMode mode; 1609 }; 1610   1614 class PED: public SdiCmd 1615 { 1616 public: 1620   enum NavigatorMode 1621   { 1622     NAVIGATOR_MODE_OFF,  1623     NAVIGATOR_MODE_DOUBLE_TAB,  1624     NAVIGATOR_MODE_TACTILE_BUTTON  1625   }; 1626   1635   void setTimeout(unsigned seconds); 1636   1644   bool setDefaultTimeout(unsigned seconds); 1645   1661   void setTouchCoordinates(const unsigned char* array, unsigned size); 1662   1667   void setNavigatorMode(enum NavigatorMode mode); 1668   1679   void setPinDigitCountMinMax(unsigned char min, unsigned char max); 1680   1687   void setLanguage(unsigned char lang); 1688   1695   void setAmount(const unsigned char* amount); 1696   1703   void setCurrency(const unsigned char* currency); 1704   1712   void setAppLabel(const std::string& appLabel); 1713   1714   1741   int startPinInput(); 1742   1753   int startPinInput(bool enablePinBypass); 1754   1774   bool startPinEntry(unsigned pinBypassKey = 0); 1775   1782   bool pollPinEntry(std::vector<unsigned char>& status); 1783   1789   bool stopPinEntry(); 1790   1799   bool setPinInputClearKeyMode(bool clearAllDigits); 1800   1807   void setClearKeyMode(bool clearAllDigits); 1808   1815   void setPinBypassKeyAndMode(unsigned char value); 1816   1823   void setAutoConfirmation(bool enable); 1824   1831   void setDialogOptions(uint32_t options); 1832   1839   void setIntercharTimeout(uint32_t millis); 1840   1849   void setHeaderLabel(const std::string& label); 1850   1857   void setEchoChar(uint32_t unicode); 1858   1877   bool sendPinInputParameters(bool epp = true); 1878   1885   enum SDI_SW12 receiveGetPinResult(); 1886   1895   bool getPinBypassKey(unsigned char& value); 1896 }; 1897   1906 class SdiCrypt: public SdiBase 1907 { 1908 public: 1909   // SDI Crypto Interface 1910   SdiCrypt(); 1911   ~SdiCrypt(); 1912   1921   bool open(const char* hostName); 1922   1929   bool close(); 1930   1936   bool isOpen() const; 1937   1944   uint32_t getCryptoHandle(); 1945   1957   bool encrypt(const std::vector<unsigned char>& data, 1958           std::vector<unsigned char>& encrypted); 1959   1971   bool decrypt(const std::vector<unsigned char>& encrypted, 1972           std::vector<unsigned char>& decrypted); 1973   1985   bool sign(const std::vector<unsigned char>& data, 1986           std::vector<unsigned char>& signature); 1987   1999   bool verify(const std::vector<unsigned char>& data, 2000           const std::vector<unsigned char>& signature); 2001   2016   bool updateKey(unsigned char keyType, const std::vector<unsigned char>& keyData, 2017           std::vector<unsigned char>* proprietaryData = NULL, 2018           const unsigned char AS2805 = 0, 2019           std::vector<unsigned char>* KCV = NULL); 2020   2032   bool setKeySetId(uint32_t ksid, uint32_t mksid = 0, bool asAttribute = false); 2033   2042   bool getEncryptedPin(unsigned char pinBlockFormat, 2043           std::vector<unsigned char>& pinBlock, 2044           bool requestZeroPinBlock = false); 2045   2051   std::string getKeyInventory(); 2052   2061   bool getKeyData(unsigned char keyType, std::vector<unsigned char>& keyData, unsigned char kekFlag = 0); 2062   2069   std::string getStatus(); 2070   2080   std::string getStatus(std::string hostName); 2081   2082   2089   static std::string getVersions(int& additionalResult); 2090   2101   void setInitialVector(const std::vector<unsigned char>& iv) 2102   { 2103     initialVector = iv; 2104   } 2105   2111   void getInitialVector(std::vector<unsigned char>& iv) const 2112   { 2113     iv = initialVector; 2114   } 2115   2116   2122   void getKeySerialNumber(std::vector<unsigned char>& ksn) const 2123   { 2124     ksn = keySerialNumber; 2125   } 2126   2130   struct Placeholder 2131   { 2132     std::vector<unsigned char> tagList;           2133     std::vector<unsigned char> applicationData;   2134     std::vector<unsigned char> dataOptions;       2135   }; 2136   2151   bool getEncData(const Placeholder& descriptor, 2152           std::vector<unsigned char>& encrypted, 2153           bool useStoredData = false, 2154           bool incrementKSN = false); 2155   2171   bool getEncMsgData(const std::vector<unsigned char>& messageTemplate, 2172           const std::vector<Placeholder>& placeholder, 2173           std::vector<unsigned char>& encrypted, 2174           bool useStoredData = false, 2175           bool incrementKSN = false); 2176   2192   bool getMsgSignature(const std::vector<unsigned char>& messageTemplate, 2193           const std::vector<Placeholder>& placeholder, 2194           std::vector<unsigned char>& signature, 2195           bool useStoredData = false, 2196           bool incrementKSN = false); 2197   2205   bool getEncTrxData(const std::vector<unsigned long> tags, std::vector<unsigned char>& data); 2206   2213   bool setEncTrxData(const std::vector<unsigned char> data); 2214   2220   bool endEncTrxData(); 2221   2222 private: 2223   unsigned char cryptoHandle[4]; 2224   std::vector<unsigned char> initialVector; 2225   std::vector<unsigned char> keySerialNumber; 2226   uint32_t keySetId; 2227   uint32_t masterKeySetId; 2228 }; 2229   2239 class ManualEntry: public SdiCmd 2240 { 2241 public: 2242   ManualEntry(); 2243   ~ManualEntry(); 2244   2251   void setLanguage(unsigned char language); 2252   2253   2260   int setTimeout(unsigned seconds); 2261   2275   int setCvvEntryDeactivation(unsigned char cvvEntry); 2276   2277   2286   int setCardDataEntryMode(unsigned char mode); 2287   2288   2295   int setCvvInputString(const std::string &inputString); 2296   2312   int setTouchCoordinates(const unsigned char* array, unsigned size); 2313   2323   int setMimimumDigits(unsigned char minimumDigits); 2324   2333   int setDoubleConfirmationMode(unsigned char mode); 2334   2355   int start(); 2356   2373   int receiveResult(std::string& obfuscatedPAN, std::vector<unsigned char>& token); 2374   2383   int getPluginResponseData(std::vector<unsigned char>& data); 2384   2398   int getPluginResponseData(unsigned index, 2399           int32_t& pluginId, 2400           int32_t& pluginResponseCode, 2401           std::vector<unsigned char>& data); 2402   2409   bool getPluginResponseData(std::vector<PluginResult>& results); 2410 }; 2411   2457 class Dialog: public SdiCmd 2458 { 2459 public: 2460   2467   2473   const static int DIALOG_SUCCESS = 0; 2474   2480   const static int DIALOG_CANCEL_PRESSED = -1; 2481   2487   const static int DIALOG_TIMEOUT = -3; 2488   2495   const static int DIALOG_SYS_ABORT = -8; 2496   2502   const static int DIALOG_CLIENT_ERROR = -14; 2503   2509   const static int DIALOG_SDI_SW12 = -15; 2510   2515   const static int DIALOG_NO_ASYNC_DIALOG = 1; 2516   2521   const static int DIALOG_IN_PROGRESS = 2; 2522   2524   2531   const static unsigned DLG_DisplayOnly       = 0x00000000; 2532   const static unsigned DLG_CancelKey         = 0x00000002; 2533   const static unsigned DLG_ClearKey          = 0x00000004; 2534   const static unsigned DLG_EnterKey          = 0x00000008; 2535   const static unsigned DLG_NoLEDs            = 0x00000010; 2536   const static unsigned DLG_CtlsLogo          = 0x00000020; 2537   const static unsigned DLG_QuestionLogo      = 0x00000040; 2538   const static unsigned DLG_WarningLogo       = 0x00000080; 2539   const static unsigned DLG_ErrorLogo         = 0x00000100; 2540   const static unsigned DLG_SuccessLogo       = 0x00000200; 2541   const static unsigned DLG_WaitLogo          = 0x00000400; 2542   const static unsigned DLG_Async             = 0x00000800; 2543   const static unsigned DLG_StoreAsyncResult  = 0x00001000; 2544   const static unsigned DLG_HideSoftKeys      = 0x00002000; 2545   const static unsigned DLG_TextAlignLeft     = 0x00004000; 2546   const static unsigned DLG_TextAlignRight    = 0x00008000; 2547   const static unsigned DLG_TextAlignTop      = 0x00010000; 2548   const static unsigned DLG_TextAlignButton   = 0x00020000; 2549   const static unsigned DLG_NoHeader          = 0x00040000; 2550   const static unsigned DLG_ClearOnReturn     = 0x00100000; 2551   const static unsigned DLG_AbortOnCardRemove = 0x00200000; 2552   const static unsigned DLG_IgnoreExtAbort    = 0x00400000; 2554   2561   const static unsigned MENU_NoOpts           = 0x00000000; 2562   const static unsigned MENU_NoLEDs           = 0x00000002; 2563   const static unsigned MENU_ClearOnReturn    = 0x00000004; 2564   const static unsigned MENU_AbortOnCardRemove= 0x00000008; 2565   const static unsigned MENU_IgnoreExtAbort   = 0x00000010; 2566   const static unsigned MENU_NoHeader         = 0x00000020; 2568   2572   enum REQUEST_CARD_MODE 2573   { 2574     REQUEST_CARD_STANDARD = 0,  2575     REQUEST_CARD_FALLBACK = 1,  2576     REQUEST_CARD_RETRY    = 2   2577   }; 2578   2587   bool clearScreen(bool epp = true); 2588   2612   int display(const std::string& text, bool epp = true); 2613   2637   int secureInput(bool epp = true); 2638   2670   int menu(bool epp = true); 2671   2689   int requestCard(unsigned char technology, 2690           enum REQUEST_CARD_MODE mode = REQUEST_CARD_STANDARD, 2691           bool epp = true); 2692   2699   bool idleScreen(bool epp = true); 2700   2716   int captureSignature(std::vector<unsigned char>& signature, std::string& format, 2717           bool epp = true); 2718   2725   static void showLedArea(bool show); 2726   2748   int htmlDialog(const std::string& fname, bool epp = true); 2749   2761   int getAsyncResult(bool epp = true); 2762   2766   static void abort(); 2767   2776   void setTemplate(unsigned char id); 2777   2786   void setInputTemplate(unsigned char id); 2787   2797   void setLanguage(unsigned char language); 2798   2810   void addData(const std::string& name, const std::string& value); 2811   2822   void setTimeout(int seconds); 2823   2836   void setOptions(unsigned options); 2837   2847   void setEnterKeyLabel(const std::string& label); 2848   2858   void setClearKeyLabel(const std::string& label); 2859   2869   void setCancelKeyLabel(const std::string& label); 2870   2880   void setUpKeyLabel(const std::string& label); 2881   2890   void setDownKeyLabel(const std::string& label); 2891   2900   void setHeader(const std::string& text); 2901   2910   void setBeep(bool active = true); 2911   2921   void addAction(const std::string& key, const std::string& action); 2922   2931   void setMaskingCharacter(char c); 2932   2941   void setAlternativeInputFormat(const char* f); 2942   2951   void setAmount(const unsigned char* amount); 2952   2963   void setCurrency(const unsigned char* currency); 2964   2975   void setTransactionType(unsigned char txnType); 2976   2985   void setMenuText(const std::string& text); 2986   2995   void addMenuItem(const std::string& item); 2996   3007   void setPreSelected(unsigned char itemNumber); 3008   3023   void setAdminMenu(unsigned char adminMenu); 3024   3033   unsigned char getSelected(); 3034   3044   std::string get(const std::string& name); 3045   3058   std::vector<std::string> getInputFieldNames(); 3059   3060 private: 3061   int startDialog(unsigned char instruction, bool epp); 3062 }; 3063   3064 } // namespace sdi 3065   3066 #ifndef DOXYGEN 3067 #endif // C++ 3068 #endif 3069 #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