mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix getFieldValue and add test
This commit is contained in:
@@ -37,6 +37,18 @@ public class SmTest {
|
||||
Assert.assertEquals(content, decryptStr);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sm4Test2() {
|
||||
String content = "test中文";
|
||||
SM4 sm4 = new SM4(Mode.CTR, Padding.PKCS5Padding);
|
||||
sm4.setIv("aaaabbbb".getBytes());
|
||||
|
||||
String encryptHex = sm4.encryptHex(content);
|
||||
String decryptStr = sm4.decryptStr(encryptHex, CharsetUtil.CHARSET_UTF_8);
|
||||
|
||||
Assert.assertEquals(content, decryptStr);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sm4ECBPKCS5PaddingTest2() {
|
||||
String content = "test中文";
|
||||
|
Reference in New Issue
Block a user