磐石加密狗NT88管理层API

直接贴代码了

  1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Runtime.InteropServices;
5
6 //class NT88API
7 //{
8 ////查找加密锁
9 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
10 // public static extern int NTFindFirst(string NTCode);
11
12 ////查询硬件ID
13 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
14 // public static extern int NTGetHardwareID(StringBuilder hardwareID);
15
16 ////登录加密锁
17 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
18 // public static extern int NTLogin(string NTpassword);
19
20 ////存储区数据读取
21 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
22 // public static extern int NTRead(int address, int Length, byte[] pData);
23
24 ////存储区数据写入
25 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
26 // public static extern int NTWrite(int address, int Length, byte[] pData);
27
28 ////3DES解密
29 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
30 // public static extern int NT3DESCBCDecrypt(byte[] vi, byte[] pDataBuffer, int Length);
31
32 ////3DES加密
33 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
34 // public static extern int NT3DESCBCEncrypt(byte[] vi, byte[] pDataBuffer, int Length);
35
36 ////验证许可证
37 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
38 // public static extern int NTCheckLicense(int licenseCode);
39
40
41
42
43 ////登出加密锁
44 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
45 // public static extern int NTLogout();
46
47 // #region 管理员API
48
49
50 ////验证管理员密码
51 // [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
52 // public static extern int NTCheckSuperPin(string superPin);
53
54
55 // #endregion
56
57
58 //}
59
60
61 class NT88API
62 {
63
64 #region 管理员用法
65 //查找所有加密锁,只有找到加密锁才能其他操作,NTFindAll必须第一个执行
66 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
67 public static extern int NTFindAll(int[] NTHandle, int[] nKeyNum);
68
69 /// <summary>
70 /// 获取加密锁硬件属性
71 /// </summary>
72 /// <param name="NTHandle">加密锁handle</param>
73 /// <param name="keyMode">加密锁型号</param>
74 /// <param name="keyVersion">硬件版本</param>
75 /// <param name="e2size">存储区大小</param>
76 /// <param name="ramSize">内存区大小</param>
77 /// <param name="prouctionTime">生产日期</param>
78 /// <returns></returns>
79 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
80 public static extern int NTGetDevCaps(int NTHandle, int[] keyMode, int[] keyVersion, int[] e2size, int[] ramSize, byte[] prouctionTime);
81
82 //获取硬件序列号
83 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
84 public static extern int NTGetHarddwareID(int NTHandle, string hardwareID);
85
86 //检测管理密码
87 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
88 public static extern int NTCheckSuperPin(int NTHandle, string superin);
89
90 //修改加密锁管理密码
91 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
92 public static extern int NTSetSuperPin(int NTHandle, string newSPin);
93
94
95 //修改加密锁登录密码
96 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
97 public static extern int NTSetUserPin(int NTHandle, string superin, string seed, StringBuilder userPin);
98
99 //修改加密锁识别码
100 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
101 public static extern int NTSetAppName(int NTHandle, StringBuilder NTCode);
102
103 //获得加密锁识别码
104 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
105 public static extern int NTGetAppName(int NTHandle, StringBuilder NTCode);
106
107 //读取存储区数据
108 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
109 public static extern int NTRead(int NTHandle, int address, int length, byte[] pData);
110
111 //读写存储区数据
112 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
113 public static extern int NTWrite(int NTHandle, int address, int length, byte[] pData);
114
115 //获取许可证标识及验证码
116 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
117 public static extern int NTGetLicenseSettings(int NTHandle, byte[] licenseOption, int[] licenseCode, int licOptionNumber);
118
119 //设置许可证标识,同时计算出验证码
120 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
121 public static extern int NTGenLicenseCodes(int NTHandle, byte[] licenseOption, int[] licenseCode, int licOptionNumber);
122
123 //验证许可证,输入相应额验证码进行验证
124 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
125 public static extern int NTCheckLicense(int NTHandle, int licenseCode);
126
127 //3DES加密
128 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
129 public static extern int NT3DESCBCEncrypt(int NTHandle, byte[] iv, byte[] pDataBuffer, int length);
130
131 //3DES设置
132 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
133 public static extern int NTSet3DESKey(int NTHandle, byte[] key);
134
135 //3DES解密
136 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
137 public static extern int NT3DESCBCDecrypt(int NTHandle, byte[] iv, byte[] pDataBuffer, int length);
138
139
140 //查询硬件ID
141 [DllImport("NT88Mgr.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
142 public static extern int NTGetHardwareID(int NTHandle, StringBuilder hardwareID);
143
144
145 #endregion
146
147
148 /*****************************************/
149
150
151 #region 应用层
152 //查找加密锁
153 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
154 public static extern int NTFindFirst(string NTCode);
155
156 //查询硬件ID
157 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
158 public static extern int NTGetHardwareID(StringBuilder hardwareID);
159
160 //登录加密锁
161 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
162 public static extern int NTLogin(string NTpassword);
163
164 //存储区数据读取
165 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
166 public static extern int NTRead(int address, int Length, byte[] pData);
167
168 //存储区数据写入
169 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
170 public static extern int NTWrite(int address, int Length, byte[] pData);
171
172 //3DES解密
173 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
174 public static extern int NT3DESCBCDecrypt(byte[] vi, byte[] pDataBuffer, int Length);
175
176 //3DES加密
177 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
178 public static extern int NT3DESCBCEncrypt(byte[] vi, byte[] pDataBuffer, int Length);
179
180 //验证许可证
181 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
182 public static extern int NTCheckLicense(int licenseCode);
183
184
185
186
187 //登出加密锁
188 [DllImport("NT88.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
189 public static extern int NTLogout();
190
191
192 #endregion
193 }

 

以上涉及到的 NT88Mgr.dll 文件可以在磐石公司提供的开发资料中查找 ,也可以点击此处下载附件

转载于:https://www.cnblogs.com/eycbest/archive/2012/03/30/2424560.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
new features: 1: Add a dongle detection method. 2: Increase the detection of a series of dongle models. Currently there are more than 50 types of dongles that can be detected. The specific types that can be detected are as follows: Flying faithful, solid integrity series dongle: Flying Integrity -ROCKEY 2 Flying Integrity -ROCKEY 3 Flying faith -ROCKEY 4 (drive type) Flying ftsafe Flying 4 Driveless Flying Integrity -ROCKEY 6 Kennedy Credit -ET199 Kennedy Credit -ET99/ET299 Feitian integrity / Kennedy integrity unknown model encryption dog Rainbow/Sailor Series dongle: Rainbow UMI Series dongle Rainbow UDA Series dongle SafeNet Elf Dog UGA (GeniusDog) Rainbow Macro Dog Rainbow Unknown series dongle SafeNet SafeNet Ultra Pro SafeNet USB Security Security Token SafeNet Sentinel Hardware Key SafeNet Sentinel Hardware Key SafeNet Sentinel Hardware Key RTC SafeNet Sentinel Hardware Key Mega-Memory SafeNet Sentinel Hardware Key Mega-Memory RTC SafeNet Sentinel Dual Hardware Key SafeNet Sentinel Dual Hardware Key RTC SafeNet HASP HL ​​SRM Dongguan domain days series dongle: Dongguan Tiantian YT88 dongle Domain Day Simple (with password) Domain days Simple type Tiantian professional/economical and easy to use Dongguan Tianzhi 32-bit smart dongle Dongguan Domain 32-bit smart dongle (with driver) Dongguan Tiantian Unknown Model Dongle Shenzhen Rock Series dongles: Deepsense (senseLock) Meditation 3 dongle Deepsense (SenseLock) SenseIV2.x Shensi 4 smart dongle SenseLock Elite E Elite Dog Deepsense (senseLock) Ling Rui dongle SenseLock OME Speed ​​3000 Pro, Driveless Dragon Pulse series dongle: Dragon Vein nox2 dongle Century Longmai NOX Dongle Dragon Pulse DAM2+ dongle Century Longmai DAM2 Streamlined Dragon Pulse DAM2 dongle Century Longmai NOX+ Single Dog, No Drive Century Longmai (Century Longmai DAM2+ Network Dog Century Longmai NOX5 Master Lock Dragon Vein NOX5 dongle Dragon Pulse other models dongle Jiang Bolong series dongle: NetCom Security Chip (SChip) Dong

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值