public static final class CryptUtils.RSA extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static KeyPair |
keyPair()
生成1024位密钥对
|
static String |
privateDecryptFromHex(String data,
byte[] key)
私钥解密
|
static String |
publicEncryptHex(String data,
byte[] key)
公钥加密
|
static PublicKey |
publicKeyFromPrivateKey(RSAPrivateCrtKey privateKey)
从私钥中获取公钥
|
public static PublicKey publicKeyFromPrivateKey(RSAPrivateCrtKey privateKey) throws Exception
privateKey - 私钥对象Exception - 失败抛出异常public static String publicEncryptHex(String data, byte[] key) throws Exception
data - 原文key - 公钥字节数组Exception - 失败抛出异常Copyright © 2021. All rights reserved.