diff --git a/hutool-crypto/src/test/java/cn/hutool/crypto/asymmetric/Issue3925Test.java b/hutool-crypto/src/test/java/cn/hutool/crypto/asymmetric/Issue3925Test.java new file mode 100644 index 000000000..fc52d2676 --- /dev/null +++ b/hutool-crypto/src/test/java/cn/hutool/crypto/asymmetric/Issue3925Test.java @@ -0,0 +1,13 @@ +package cn.hutool.crypto.asymmetric; + +import org.bouncycastle.crypto.DataLengthException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class Issue3925Test { + @Test + void sm2Test() { + final SM2 sm2 = new SM2(); + Assertions.assertThrows(DataLengthException.class, ()->sm2.encrypt("", KeyType.PublicKey)); + } +}