转换密钥 @param key 二进制密钥 @return Key 密钥 @throws Exception
(byte[] key)
| 57 | * @throws Exception |
| 58 | */ |
| 59 | private static Key toKey(byte[] key) { |
| 60 | // 实例化AES密钥材料 |
| 61 | SecretKey secretKey = new SecretKeySpec(key, KEY_ALGORITHM); |
| 62 | |
| 63 | return secretKey; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * 解密 |