代码拉取完成,页面将自动刷新
using ControllerClient;
using ControlMachine;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
namespace NewCash2DeviceServer
{
class SignatureInfoHelper
{
static byte[] CAData = new byte[256];
static byte[] SiGN = new byte[1024];
[DllImport("RFIDDll.dll")]
public static extern int RFID_SIGNSha1(byte[] SentData, byte[] CAData, byte[] SiGN);
public static SignatureInfo getsignatureInfo(string signdata)
{
byte[] SentData = System.Text.Encoding.UTF8.GetBytes(signdata);
int ret = RFID_SIGNSha1(SentData, CAData, SiGN);
if (ret < 0)
{
Debug.WriteLine("签名数据获取失败");
return null;
}
else
{
SignatureInfo sighinfo = new SignatureInfo();
sighinfo.Cadata = ControllerClient.UserTool.StringAndBytesHelper.ToHexString(CAData, CAData.Length);
Debug.WriteLine("SiGN=" + StringAndBytesHelper.ToHexString(SiGN, SiGN.Length));
sighinfo.Sighdata = StringAndBytesHelper.ToHexString(SiGN, SiGN.Length).Substring(0, ret * 2);
return sighinfo;
}
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。