Encypt tool and Decrypt

This commit is contained in:
xiaoyu830411
2012-08-31 12:58:55 +08:00
parent d7b39faf74
commit 56d125d4d6
37 changed files with 1327 additions and 928 deletions
@@ -221,16 +221,6 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
protected AtomicLong createCount = new AtomicLong();
protected AtomicLong destroyCount = new AtomicLong();
protected Decrypter decrypter;
public Decrypter getDecrypter() {
return decrypter;
}
public void setDecrypter(Decrypter decrypter) {
this.decrypter = decrypter;
}
public boolean isOracle() {
return isOracle;
}
@@ -934,9 +924,9 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
this.jdbcUrl = jdbcUrl;
if (jdbcUrl.startsWith(ConfigFilter.URL_PREFIX)) {
this.filters.add(new ConfigFilter());
}
// if (jdbcUrl.startsWith(ConfigFilter.URL_PREFIX)) {
// this.filters.add(new ConfigFilter());
// }
}
public String getDriverClassName() {
@@ -1247,18 +1237,6 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
}
}
Decrypter decrypter1 = this.getDecrypter();
if (decrypter1 != null) {
try {
SensitiveParameters parameters = decrypter1.decrypt(new SensitiveParameters(url, user, password));
url = parameters.getUrl();
user = parameters.getUsername();
password = parameters.getPassword();
} catch (DecryptException e) {
throw new SQLException("Failed to decrypt sensitive parameters.", e);
}
}
Properties physicalConnectProperties = new Properties();
if (connectProperties != null) {
physicalConnectProperties.putAll(connectProperties);