From 9fec53f8f2c0996729665afbc57925bee4a36d2b Mon Sep 17 00:00:00 2001 From: Looly Date: Sat, 8 Jul 2023 19:11:30 +0800 Subject: [PATCH] fix test --- .../org/dromara/hutool/crypto/asymmetric/ECIESTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hutool-crypto/src/test/java/org/dromara/hutool/crypto/asymmetric/ECIESTest.java b/hutool-crypto/src/test/java/org/dromara/hutool/crypto/asymmetric/ECIESTest.java index af3b9ff67..89c03b23c 100644 --- a/hutool-crypto/src/test/java/org/dromara/hutool/crypto/asymmetric/ECIESTest.java +++ b/hutool-crypto/src/test/java/org/dromara/hutool/crypto/asymmetric/ECIESTest.java @@ -1,5 +1,6 @@ package org.dromara.hutool.crypto.asymmetric; +import org.bouncycastle.jce.spec.IESParameterSpec; import org.dromara.hutool.core.text.StrUtil; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -9,15 +10,23 @@ public class ECIESTest { @Test public void eciesTest(){ final ECIES ecies = new ECIES(); + final IESParameterSpec iesParameterSpec = new IESParameterSpec(null, null, 128); + ecies.setAlgorithmParameterSpec(iesParameterSpec); doTest(ecies, ecies); } @Test public void eciesTest2(){ + final IESParameterSpec iesParameterSpec = new IESParameterSpec(null, null, 128); + final ECIES ecies = new ECIES(); + ecies.setAlgorithmParameterSpec(iesParameterSpec); + final byte[] privateKeyBytes = ecies.getPrivateKey().getEncoded(); final ECIES ecies2 = new ECIES(privateKeyBytes, null); + ecies2.setAlgorithmParameterSpec(iesParameterSpec); + doTest(ecies, ecies2); }