mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-02 20:02:49 +08:00
add test
This commit is contained in:
parent
26ccc50c89
commit
8319b00918
@ -0,0 +1,20 @@
|
|||||||
|
package cn.hutool.crypto.test;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.Mode;
|
||||||
|
import cn.hutool.crypto.Padding;
|
||||||
|
import cn.hutool.crypto.symmetric.AES;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class AESTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void encryptTest() {
|
||||||
|
// 构建
|
||||||
|
AES aes = new AES(Mode.CBC, Padding.PKCS5Padding,
|
||||||
|
"1234567890123456".getBytes(), "1234567890123456".getBytes());
|
||||||
|
String encryptHex = aes.encryptHex("123456");
|
||||||
|
Assert.assertEquals("d637735ae9e21ba50cb686b74fab8d2c", encryptHex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user