public final class RSASign extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
RSASign.SignAlgorithm
限定了对于RSA合法算法的算法集
|
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
checkSign(byte[] content,
byte[] sign,
byte[] publicKey,
RSASign.SignAlgorithm algorithm)
RSA验签检查
|
static boolean |
checkSign(byte[] content,
byte[] sign,
RSAPublicKey publicKey,
RSASign.SignAlgorithm algorithm)
RSA签名验证
|
static byte[] |
sign(byte[] content,
byte[] privateKey,
RSASign.SignAlgorithm algorithm)
RSA签名
|
static byte[] |
sign(byte[] content,
RSAPrivateKey privateKey,
RSASign.SignAlgorithm algorithm)
RSA签名
|
public static byte[] sign(byte[] content,
byte[] privateKey,
RSASign.SignAlgorithm algorithm)
throws SignatureException,
InvalidKeyException,
InvalidKeySpecException
content - 待签名数据privateKey - 私钥algorithm - 签名算法SignatureException - 签名出错时抛出InvalidKeyException - 无效密钥,当密钥错误或无效时抛出InvalidKeySpecException - 密钥规范无效public static byte[] sign(byte[] content,
RSAPrivateKey privateKey,
RSASign.SignAlgorithm algorithm)
throws InvalidKeySpecException,
SignatureException,
InvalidKeyException
content - 待签名数据privateKey - RSA私钥对象algorithm - 签名算法SignatureException - 签名出错时抛出InvalidKeyException - 无效密钥,当密钥错误或无效时抛出InvalidKeySpecException - 密钥规范无效public static boolean checkSign(byte[] content,
byte[] sign,
byte[] publicKey,
RSASign.SignAlgorithm algorithm)
throws InvalidKeySpecException,
InvalidKeyException,
SignatureException
content - 待验签数据sign - 签名值publicKey - RSA公钥algorithm - 签名算法SignatureException - 签名出错时抛出InvalidKeyException - 无效密钥,当密钥错误或无效时抛出InvalidKeySpecException - 密钥规范无效public static boolean checkSign(byte[] content,
byte[] sign,
RSAPublicKey publicKey,
RSASign.SignAlgorithm algorithm)
throws InvalidKeySpecException,
InvalidKeyException,
SignatureException
content - 待验证内容sign - 签名值publicKey - RSA公钥对象algorithm - 签名算法InvalidKeySpecException - 密钥规范无效异常InvalidKeyException - 密钥无效异常SignatureException - 签名异常Copyright © 2020. All rights reserved.