mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
1.修复自定义加密key的bug;2.修改生成随机密码的main方法。
This commit is contained in:
@@ -215,7 +215,7 @@ public class ConfigFilter extends FilterAdapter {
|
||||
public PublicKey getPublicKey(Properties connectinProperties, Properties configFileProperties) {
|
||||
String key = null;
|
||||
if (configFileProperties != null) {
|
||||
configFileProperties.getProperty(CONFIG_KEY);
|
||||
key = configFileProperties.getProperty(CONFIG_KEY);
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(key) && connectinProperties != null) {
|
||||
|
||||
@@ -46,8 +46,11 @@ public class ConfigTools {
|
||||
public static final String DEFAULT_PUBLIC_KEY_STRING = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKHGwq7q2RmwuRgKxBypQHw0mYu4BQZ3eMsTrdK8E6igRcxsobUC7uT0SoxIjl1WveWniCASejoQtn/BY6hVKWsCAwEAAQ==";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String password = args[0];
|
||||
System.out.println(encrypt(password));
|
||||
String password = args[0];
|
||||
String[] arr = genKeyPair(512);
|
||||
System.out.println("privateKey:" + arr[0]);
|
||||
System.out.println("publicKey:" + arr[1]);
|
||||
System.out.println("password:" + encrypt(arr[0], password));
|
||||
}
|
||||
|
||||
public static String decrypt(String cipherText) throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user