RSA验签方式设值

This commit is contained in:
maxf 2018-12-21 14:57:32 +08:00
parent 7368baf553
commit a250530fd1

View File

@ -376,7 +376,8 @@ public class RSA {
* @return * @return
* @throws UnsupportedEncodingException * @throws UnsupportedEncodingException
*/ */
public static boolean verify(String plaintext, String signStr, RSAPublicKey publicKey) throws UnsupportedEncodingException { public static boolean verify(String plaintext, String signStr, RSAPublicKey publicKey) throws UnsupportedEncodingException, NoSuchAlgorithmException {
signature = Signature.getInstance(signAlgorithm.getValue());
boolean isValid = false; boolean isValid = false;
try { try {
signature.initVerify(publicKey); signature.initVerify(publicKey);