public class RSAUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
RSA_ALGORITHM |
static String |
UTF8 |
| 构造器和说明 |
|---|
RSAUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decryptByPublicKey(String data,
RSAPublicKey rsaPublicKey)
公钥解密
|
static String |
decryptByPublicKey(String data,
String rsaPublicKey) |
static String |
encryptByPublicKey(String data,
RSAPublicKey publicKey)
公钥加密
|
static String |
encryptByPublicKey(String data,
String publicKey) |
static RSAPublicKey |
getPublicKey(byte[] pubKeyData)
获取公钥对象
|
static RSAPublicKey |
getPublicKey(String pubKey)
获取公钥对象
|
public static RSAPublicKey getPublicKey(byte[] pubKeyData) throws Exception
pubKeyData - Exceptionpublic static RSAPublicKey getPublicKey(String pubKey) throws Exception
pubKey - 公钥Exceptionpublic static String encryptByPublicKey(String data, String publicKey) throws Exception
Exceptionpublic static String encryptByPublicKey(String data, RSAPublicKey publicKey) throws Exception
data - publicKey - Exceptionpublic static String decryptByPublicKey(String data, String rsaPublicKey) throws Exception
Exceptionpublic static String decryptByPublicKey(String data, RSAPublicKey rsaPublicKey) throws Exception
data - rsaPublicKey - ExceptionCopyright © 2021. All Rights Reserved.