mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
change link
This commit is contained in:
@@ -61,7 +61,7 @@ public class KeyUtilTest {
|
||||
|
||||
@Test
|
||||
public void generateSm4KeyTest(){
|
||||
// https://github.com/dromara/hutool/issues/2150
|
||||
// https://github.com/chinabugotech/hutool/issues/2150
|
||||
assertEquals(16, KeyUtil.generateKey("sm4").getEncoded().length);
|
||||
assertEquals(32, KeyUtil.generateKey("sm4", 256).getEncoded().length);
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ public class PemUtilTest {
|
||||
@Test
|
||||
@Disabled
|
||||
public void readECPrivateKeyTest2() {
|
||||
// https://gitee.com/dromara/hutool/issues/I37Z75
|
||||
// https://gitee.com/chinabugotech/hutool/issues/I37Z75
|
||||
final byte[] d = PemUtil.readPem(FileUtil.getInputStream("d:/test/keys/priv.key"));
|
||||
final byte[] publicKey = PemUtil.readPem(FileUtil.getInputStream("d:/test/keys/pub.key"));
|
||||
|
||||
|
@@ -6,14 +6,15 @@ import cn.hutool.crypto.digest.mac.SM4MacEngine;
|
||||
import org.bouncycastle.crypto.CipherParameters;
|
||||
import org.bouncycastle.crypto.params.KeyParameter;
|
||||
import org.bouncycastle.crypto.params.ParametersWithIV;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class CBCBlockCipherMacEngineTest {
|
||||
|
||||
@Test
|
||||
public void SM4CMACTest(){
|
||||
// https://github.com/dromara/hutool/issues/2206
|
||||
// https://github.com/chinabugotech/hutool/issues/2206
|
||||
final byte[] key = new byte[16];
|
||||
final CipherParameters parameter = new KeyParameter(KeyUtil.generateKey("SM4", key).getEncoded());
|
||||
Mac mac = new Mac(new SM4MacEngine(parameter));
|
||||
@@ -27,7 +28,7 @@ public class CBCBlockCipherMacEngineTest {
|
||||
|
||||
@Test
|
||||
public void SM4CMACWithIVTest(){
|
||||
// https://github.com/dromara/hutool/issues/2206
|
||||
// https://github.com/chinabugotech/hutool/issues/2206
|
||||
final byte[] key = new byte[16];
|
||||
final byte[] iv = new byte[16];
|
||||
CipherParameters parameter = new KeyParameter(KeyUtil.generateKey("SM4", key).getEncoded());
|
||||
|
@@ -5,11 +5,12 @@ import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.crypto.KeyUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.crypto.symmetric.ZUC;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Hmac单元测试
|
||||
* @author Looly
|
||||
@@ -84,7 +85,7 @@ public class HmacTest {
|
||||
|
||||
@Test
|
||||
public void sm4CMACTest(){
|
||||
// https://github.com/dromara/hutool/issues/2206
|
||||
// https://github.com/chinabugotech/hutool/issues/2206
|
||||
final byte[] key = new byte[16];
|
||||
HMac mac = new HMac(HmacAlgorithm.SM4CMAC,
|
||||
KeyUtil.generateKey("SM4", key));
|
||||
|
@@ -10,7 +10,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/I4EMST
|
||||
* https://gitee.com/chinabugotech/hutool/issues/I4EMST
|
||||
*/
|
||||
public class Sm4StreamTest {
|
||||
|
||||
|
Reference in New Issue
Block a user