mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
7.0.0.M1
This commit is contained in:
@@ -77,7 +77,7 @@ public class KeyUtilTest {
|
||||
|
||||
@Test
|
||||
public void generateSm4KeyTest(){
|
||||
// https://github.com/dromara/hutool/issues/2150
|
||||
// https://github.com/chinabugotech/hutool/issues/2150
|
||||
Assertions.assertEquals(16, KeyUtil.generateKey("sm4").getEncoded().length);
|
||||
Assertions.assertEquals(32, KeyUtil.generateKey("sm4", 256).getEncoded().length);
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ public class RSATest {
|
||||
|
||||
@Test
|
||||
public void rsaECBTest() {
|
||||
final RSA rsa = new RSA(AsymmetricAlgorithm.RSA_ECB.getValue());
|
||||
final RSA rsa = new RSA(AsymmetricAlgorithm.RSA_ECB_PKCS1.getValue());
|
||||
|
||||
// 获取私钥和公钥
|
||||
assertNotNull(rsa.getPrivateKey());
|
||||
|
@@ -94,7 +94,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"));
|
||||
|
||||
|
@@ -29,7 +29,7 @@ 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());
|
||||
final Mac mac = new Mac(new SM4MacEngine(parameter));
|
||||
@@ -43,7 +43,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());
|
||||
|
@@ -102,7 +102,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];
|
||||
final HMac mac = new HMac(HmacAlgorithm.SM4CMAC,
|
||||
KeyUtil.generateKey("SM4", key));
|
||||
|
@@ -27,7 +27,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
/**
|
||||
* https://gitee.com/dromara/hutool/issues/I4EMST
|
||||
* https://gitee.com/chinabugotech/hutool/issues/I4EMST
|
||||
*/
|
||||
public class Sm4StreamTest {
|
||||
|
||||
|
Reference in New Issue
Block a user