mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix test
This commit is contained in:
parent
0e2f698ec3
commit
25b831c214
@ -1,6 +1,7 @@
|
|||||||
package cn.hutool.crypto.asymmetric;
|
package cn.hutool.crypto.asymmetric;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import org.bouncycastle.jce.spec.IESParameterSpec;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
@ -9,15 +10,22 @@ public class ECIESTest {
|
|||||||
@Test
|
@Test
|
||||||
public void eciesTest(){
|
public void eciesTest(){
|
||||||
final ECIES ecies = new ECIES();
|
final ECIES ecies = new ECIES();
|
||||||
|
final IESParameterSpec iesParameterSpec = new IESParameterSpec(null, null, 128);
|
||||||
|
ecies.setAlgorithmParameterSpec(iesParameterSpec);
|
||||||
|
|
||||||
doTest(ecies, ecies);
|
doTest(ecies, ecies);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void eciesTest2(){
|
public void eciesTest2(){
|
||||||
|
final IESParameterSpec iesParameterSpec = new IESParameterSpec(null, null, 128);
|
||||||
|
|
||||||
final ECIES ecies = new ECIES();
|
final ECIES ecies = new ECIES();
|
||||||
|
ecies.setAlgorithmParameterSpec(iesParameterSpec);
|
||||||
|
|
||||||
final byte[] privateKeyBytes = ecies.getPrivateKey().getEncoded();
|
final byte[] privateKeyBytes = ecies.getPrivateKey().getEncoded();
|
||||||
final ECIES ecies2 = new ECIES(privateKeyBytes, null);
|
final ECIES ecies2 = new ECIES(privateKeyBytes, null);
|
||||||
|
ecies2.setAlgorithmParameterSpec(iesParameterSpec);
|
||||||
|
|
||||||
doTest(ecies, ecies2);
|
doTest(ecies, ecies2);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user