mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
026da32fb3
commit
e1050537df
@ -113,6 +113,20 @@ public class SymmetricTest {
|
|||||||
Assert.assertEquals(content, decryptStr);
|
Assert.assertEquals(content, decryptStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void aesPkcs7PaddingTest() {
|
||||||
|
String content = RandomUtil.randomString(RandomUtil.randomInt(200));
|
||||||
|
AES aes = new AES("CBC", "PKCS7Padding",
|
||||||
|
"0123456789ABHAEQ".getBytes(),
|
||||||
|
"DYgjCEIMVrj2W9xN".getBytes());
|
||||||
|
|
||||||
|
// 加密为16进制表示
|
||||||
|
String encryptHex = aes.encryptHex(content);
|
||||||
|
// 解密
|
||||||
|
String decryptStr = aes.decryptStr(encryptHex);
|
||||||
|
Assert.assertEquals(content, decryptStr);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void desTest() {
|
public void desTest() {
|
||||||
String content = "test中文";
|
String content = "test中文";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user