This commit is contained in:
egan
2018-07-24 10:19:53 +08:00
parent dd3f245726
commit 7c1b5a8ae1

View File

@@ -81,6 +81,6 @@ public class RSA2 {
public static String encrypt(String content, String publicKey, String cipherAlgorithm, String characterEncoding ) throws Exception {
return new String(Base64.getDecoder().decode(RSA.encrypt(content.getBytes(Charset.forName(characterEncoding)), RSA.getPublicKey(publicKey), 2048, 11, cipherAlgorithm)), characterEncoding);
return Base64.encode(RSA.encrypt(content.getBytes(Charset.forName(characterEncoding)), RSA.getPublicKey(publicKey), 2048, 11, cipherAlgorithm));
}
}