mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix code
This commit is contained in:
parent
ca01481f88
commit
466bb90298
@ -41,7 +41,7 @@ import java.security.PublicKey;
|
|||||||
import java.security.spec.KeySpec;
|
import java.security.spec.KeySpec;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EC密钥参数相关工具类封装
|
* 椭圆曲线EC(Elliptic Curves)密钥参数相关工具类封装
|
||||||
*
|
*
|
||||||
* @author looly
|
* @author looly
|
||||||
* @since 5.4.3
|
* @since 5.4.3
|
||||||
@ -319,7 +319,7 @@ public class ECKeyUtil {
|
|||||||
public static PrivateKey toSm2PrivateKey(final ECPrivateKey privateKey) {
|
public static PrivateKey toSm2PrivateKey(final ECPrivateKey privateKey) {
|
||||||
try {
|
try {
|
||||||
final PrivateKeyInfo info = new PrivateKeyInfo(
|
final PrivateKeyInfo info = new PrivateKeyInfo(
|
||||||
new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, SmUtil.ID_SM2_PUBLIC_KEY_PARAM), privateKey);
|
new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, SmUtil.ID_SM2_PUBLIC_KEY_PARAM), privateKey);
|
||||||
return KeyUtil.generatePrivateKey("SM2", info.getEncoded());
|
return KeyUtil.generatePrivateKey("SM2", info.getEncoded());
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
throw new IORuntimeException(e);
|
throw new IORuntimeException(e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user