mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
SM2.signHex改名为signHexFromHex,原名标记废弃,避免歧义
This commit is contained in:
@@ -472,6 +472,29 @@ public class SM2 extends AbstractAsymmetricCrypto<SM2> {
|
||||
|
||||
// region ----- Sign and Verify
|
||||
|
||||
/**
|
||||
* 用私钥对信息生成数字签名
|
||||
*
|
||||
* @param dataHex 被签名的数据数据(Hex格式)
|
||||
* @return 签名
|
||||
* @since 5.8.33
|
||||
*/
|
||||
public String signHexFromHex(final String dataHex) {
|
||||
return signHexFromHex(dataHex, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用私钥对信息生成数字签名
|
||||
*
|
||||
* @param dataHex 被签名的数据数据(Hex格式)
|
||||
* @param idHex 可以为null,若为null,则默认withId为字节数组:"1234567812345678".getBytes()
|
||||
* @return 签名
|
||||
* @since 5.8.33
|
||||
*/
|
||||
public String signHexFromHex(final String dataHex, final String idHex) {
|
||||
return HexUtil.encodeStr(sign(HexUtil.decode(dataHex), HexUtil.decode(idHex)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用私钥对信息生成数字签名
|
||||
*
|
||||
|
Reference in New Issue
Block a user