public class SignUtil extends Object
| 构造器和说明 |
|---|
SignUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
BASE64Decode(String source)
功能描述: base64 解密
|
static Boolean |
check(String source,
String merSign,
PublicKey publicKey)
功能描述: 签名检查
|
static Boolean |
checkSign_(String source,
String merSign,
String keyCode)
功能描述: 签名检查
|
static Boolean |
checkSign(String source,
String merSign,
String pemPath)
功能描述:签名检查
|
static String |
encryptSign_(String source,
String keyCode)
功能描述: 根据秘钥串儿签名
|
static String |
encryptSign(String source,
String pemPath)
功能描述: 签名 RSA+SHA1withRSA(签名)
|
static PrivateKey |
getPrivateKey(String keyCode) |
static PrivateKey |
getPrivateKeyByPath(String privatePemPath)
功能描述:获取私钥
|
static PublicKey |
getPublicKey(String keyCode) |
static PublicKey |
getPublicKeyByPath(String pubPemPath)
功能描述: 获取公钥
|
static String |
sign(PrivateKey pk,
String source)
功能描述:生成签名
|
public static String encryptSign(String source, String pemPath) throws Exception
source - 待签名串儿pemPath - 私钥路径Exception - Stringpublic static String encryptSign_(String source, String keyCode)
source - 被签名字符keyCode - 秘钥串儿public static String sign(PrivateKey pk, String source) throws Exception
pk - source - Exception - Stringpublic static Boolean checkSign(String source, String merSign, String pemPath)
source - 签名前merSign - 加密串pemPath - 公钥路径public static Boolean checkSign_(String source, String merSign, String keyCode)
source - merSign - keyCode - public static Boolean check(String source, String merSign, PublicKey publicKey)
source - merSign - publicKey - public static byte[] BASE64Decode(String source) throws IOException
source - IOException - byte[]public static PublicKey getPublicKeyByPath(String pubPemPath)
pubPemPath - public static PrivateKey getPrivateKeyByPath(String privatePemPath)
privatePemPath - public static PrivateKey getPrivateKey(String keyCode) throws Exception
ExceptionCopyright © 2018. All rights reserved.