public class ConfigTools extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEFAULT_PUBLIC_KEY_STRING |
| 构造器和说明 |
|---|
ConfigTools() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decrypt(PublicKey publicKey,
String cipherText) |
static String |
decrypt(String cipherText) |
static String |
decrypt(String publicKeyText,
String cipherText) |
static String |
encrypt(byte[] keyBytes,
String plainText) |
static String |
encrypt(String plainText) |
static String |
encrypt(String key,
String plainText) |
static String[] |
genKeyPair(int keySize) |
static byte[][] |
genKeyPairBytes(int keySize) |
static PublicKey |
getPublicKey(String publicKeyText) |
static PublicKey |
getPublicKeyByPublicKeyFile(String publicKeyFile) |
static PublicKey |
getPublicKeyByX509(String x509File) |
static void |
main(String[] args) |
public static String decrypt(String publicKeyText, String cipherText) throws Exception
Exceptionpublic static PublicKey getPublicKeyByPublicKeyFile(String publicKeyFile)
public static String decrypt(PublicKey publicKey, String cipherText) throws Exception
Exceptionpublic static String encrypt(byte[] keyBytes, String plainText) throws Exception
Exceptionpublic static byte[][] genKeyPairBytes(int keySize)
throws NoSuchAlgorithmException
public static String[] genKeyPair(int keySize) throws NoSuchAlgorithmException
Copyright © 2013-2014 Alibaba Group. All Rights Reserved.