| 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 | | package com.zy.acs.gateway.constant; |  |   |  | /** |  |  * 加密标识枚举 |  |  * Created by vincent on 2019-04-02 |  |  */ |  | public enum EncryType implements ICodedStatus { |  |   |  |     /** |  |      * 数据不加密 |  |       */ |  |     ENCRY_EMPTY(0x01), |  |     /** |  |      * RSA算法加密 |  |      */ |  |     ENCRY_RSA(0x02), |  |     /** |  |      * AES128位算法加密 |  |      */ |  |     ENCRY_AES128(0x03), |  |     /** |  |      * 异常 |  |      */ |  |     ENCRY_EXCEPTION(0xFE), |  |     /** |  |      * 无效 |  |      */ |  |     ENCRY_INVALID(0xFF); |  |   |  |     /** |  |      * 其他数值为预留 |  |      */ |  |   |  |     private int code; |  |     EncryType(int code) { |  |         this.code = code; |  |     } |  |   |  |   |  |     public static EncryType getByCode(int code) { |  |         for (EncryType e : |  |                 EncryType.values()) { |  |             if (e.getCode() == code) { |  |                 return e; |  |             } |  |         } |  |         return null; |  |     } |  |   |  |     @Override |  |     public int getCode() { |  |         return code; |  |     } |  |   |  |     // 预期的期望值,逗号分隔 |  |     public static String expectedVals() { |  |         StringBuilder valSb = new StringBuilder(); |  |         for (EncryType c : |  |                 EncryType.values()) { |  |             valSb.append(c.getCode()).append(","); |  |         } |  |         // 删除最后一个逗号 |  |         valSb.deleteCharAt(valSb.length() - 1); |  |         return valSb.toString(); |  |     } |  | } | 
 |