转换密钥 @param key 二进制密钥 @return Key 密钥 @throws Exception
(byte[] key)
| 54 | * @throws Exception |
| 55 | */ |
| 56 | private static Key toKey(byte[] key) { |
| 57 | // 生成秘密密钥 |
| 58 | SecretKey secretKey = new SecretKeySpec(key, KEY_ALGORITHM); |
| 59 | |
| 60 | return secretKey; |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * 解密 |