public abstract class RSASecurityUtils extends Object
| 构造器和说明 |
|---|
RSASecurityUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decrypt(String cryptograph,
Key key)
解密算法
|
static String |
encrypt(String source,
Key key)
加密方法
|
static KeyPair |
generateKeyPair() |
static KeyPair |
generateKeyPair(int keysize)
生成密钥对
|
static KeyPair |
keyPairFromJson(String keyJsonString) |
static String |
keyPairToJson(KeyPair keyPair) |
public static KeyPair generateKeyPair(int keysize) throws Exception
keysize - 密码大小Exception - 父类抛出的异常public static String encrypt(String source, Key key) throws Exception
source - 源数据 加密字符串长度受秘钥长度的限制,最多加密245个字节key - 密码Exception - 父类抛出的异常public static String decrypt(String cryptograph, Key key) throws Exception
cryptograph - 密文key - 密码Exception - 父类抛出的异常public static KeyPair keyPairFromJson(String keyJsonString) throws InvalidKeyException
Copyright © 2017. All rights reserved.