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
| package com.walker.security.admin;
|
| import java.io.File;
|
| /**
| * 协议生成器接口定义
| * @author shikeying
| * @date 2014-3-26
| *
| */
| public interface LisenceGenerator {
|
| String getSecretKey();
|
| String getPublicKey();
|
| /**
| * 生成协议对象,具体是哪种类型对象由子类决定。</p>
| * 最终生成的协议中包含了输入信息,如:IP、MAC地址、日期等,还包括生成的公匙。
| * <pre>
| * 1) type: 类型, 0 仅IP, 1 仅时间, 2 IP和时间
| * </pre>
| * @param message 用户提供的可识别的固定信息,如IP、MAC等。
| * @return
| */
| Object generate(String message, File destFile) throws Exception;
|
| /**
| * 直接生产协议内容,不写入文件
| * @param message
| * @return 返回协议内容
| * @throws Exception
| */
| byte[] generate(String message) throws Exception;
|
| void print();
| }
|
|