From a920b9b0aadd8fe78164f803e35ddf10c5c7c7cc Mon Sep 17 00:00:00 2001 From: lin Date: Thu, 6 Jan 2022 12:24:24 +0800 Subject: [PATCH] fix SM2.getDHex() Method --- .../src/main/java/cn/hutool/crypto/asymmetric/SM2.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2.java b/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2.java index 278ecf1cc..553b9dfdb 100644 --- a/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2.java +++ b/hutool-crypto/src/main/java/cn/hutool/crypto/asymmetric/SM2.java @@ -531,7 +531,7 @@ public class SM2 extends AbstractAsymmetricCrypto { * @since 5.7.17 */ public String getDHex() { - return getDBigInteger().toString(16); + return String.format("%064x", new BigInteger(1, getD())); } /**