qiye.163.com

This commit is contained in:
MaxKey
2022-02-27 15:34:40 +08:00
parent feabbcdd97
commit 6578897137
2 changed files with 92 additions and 2 deletions

View File

@@ -208,7 +208,7 @@ public final class RSAUtils {
return cipher.doFinal(data);
}
public byte[] sign(byte[] src, RSAPrivateKey privateKey, String algorithm) {
public static byte[] sign(byte[] src, RSAPrivateKey privateKey, String algorithm) {
if(StringUtils.isBlank(algorithm)) {
algorithm = "SHA1withRSA";
}
@@ -223,7 +223,7 @@ public final class RSAUtils {
}
}
public boolean verify(byte[] sign, byte[] src, RSAPublicKey publicKey, String algorithm) {
public static boolean verify(byte[] sign, byte[] src, RSAPublicKey publicKey, String algorithm) {
try {
if(StringUtils.isBlank(algorithm)) {
algorithm = "SHA1withRSA";