ECDSA签名算法
package com.albedo.security;
/**
* DSA 加解密实现
*/
public class ECDSAUtils extends Base {
//字符编码
public static final String ALGORITHM = "EC";
public static final String SIGN_ALGORITHM = "SHA1withECDSA";
/**
* ECDSA 验签
*
* @param sign 加密签名
* @param str 加密字符串
* @param publicKey 公钥
* @return 密文
* @throws Exception 加密过程中的异常信息
*/
public static boolean verify(String sign, String str, String publicKey) throws Exception {
return verify(sign, str, publicKey, ALGORITHM, SIGN_ALGORITHM);
}
/**
* ECDSA 签名
*
* @param str 加密字符串
* @param privateKey 私钥
* @return 铭文
* @throws Exception 解密过程中的异常信息
*/
public static String sign(Strin