password_machine.h
1.07 KB
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
#ifndef ETRADECLIENT_HARDWARE_PASSWORD_MACHINE_H_INCLUDED
#define ETRADECLIENT_HARDWARE_PASSWORD_MACHINE_H_INCLUDED
/*Password machine is used to calculate the password for verifying the DILI card.
*/
/*
密码机信息:
生产厂商:广州江南科友科技股份有限公司
型号:(未知)
*/
#include <string>
#include <cstdint>
#include "tinyxml.h"
class PWDMachine
{
public:
PWDMachine();
~PWDMachine();
//bool ReadConfig();
std::string GetPassword(const std::string& key_idx, // 密钥索引
const std::string& card_sn, // 卡序列号(卡片内码),用作离散数据
uint32_t timeout,
std::string sPWMIP,
uint32_t u32PWMPort) const; // 单位:毫秒
private:
mutable int32_t m_socket;
CString GetModulePath();
//std::string m_sPWMIP;
//uint32_t m_u32PWMPort;
bool Connect(const std::string& ip, uint32_t port) const;
void Disconnect() const;
std::string GetCardPassword(const std::string& key_idx, // 密钥索引
const std::string& card_sn, // 卡序列号(卡片内码),用作离散数据
uint32_t timeout) const; // 单位:毫秒
}; // PWDMachine
#endif // ETRADECLIENT_HARDWARE_PASSWORD_MACHINE_H_INCLUDED