mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
remove length
This commit is contained in:
@@ -74,6 +74,20 @@ public class SmTest {
|
||||
Assert.assertEquals(content, decryptStr);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sm4TestWithCustomKeyTest2() {
|
||||
String content = "test中文frfewrewrwerwer---------------------------------------------------";
|
||||
|
||||
byte[] key = KeyUtil.generateKey(SM4.ALGORITHM_NAME, 128).getEncoded();
|
||||
|
||||
SM4 sm4 = SmUtil.sm4(key);
|
||||
Assert.assertEquals("SM4", sm4.getCipher().getAlgorithm());
|
||||
|
||||
String encryptHex = sm4.encryptHex(content);
|
||||
String decryptStr = sm4.decryptStr(encryptHex, CharsetUtil.CHARSET_UTF_8);
|
||||
Assert.assertEquals(content, decryptStr);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hmacSm3Test() {
|
||||
String content = "test中文";
|
||||
|
Reference in New Issue
Block a user