use of org.gluu.oxauth.service.common.EncryptionService in project oxAuth by GluuFederation.
the class AppInitializer method prepareAuthConnectionProperties.
private Properties prepareAuthConnectionProperties(GluuLdapConfiguration persistenceAuthConfig, String persistenceType) {
String prefix = persistenceType + "#";
FileConfiguration configuration = configurationFactory.getPersistenceConfiguration().getConfiguration();
Properties properties = (Properties) configuration.getProperties().clone();
if (persistenceAuthConfig != null) {
properties.setProperty(prefix + "servers", buildServersString(persistenceAuthConfig.getServers()));
String bindDn = persistenceAuthConfig.getBindDN();
if (StringHelper.isNotEmpty(bindDn)) {
properties.setProperty(prefix + "bindDN", bindDn);
properties.setProperty(prefix + "bindPassword", persistenceAuthConfig.getBindPassword());
}
properties.setProperty(prefix + "useSSL", Boolean.toString(persistenceAuthConfig.isUseSSL()));
properties.setProperty(prefix + "maxconnections", Integer.toString(persistenceAuthConfig.getMaxConnections()));
// Remove internal DB trustStoreFile property
properties.remove(prefix + "ssl.trustStoreFile");
properties.remove(prefix + "ssl.trustStorePin");
properties.remove(prefix + "ssl.trustStoreFormat");
}
EncryptionService securityService = encryptionServiceInstance.get();
Properties decrypytedProperties = securityService.decryptAllProperties(properties);
return decrypytedProperties;
}
use of org.gluu.oxauth.service.common.EncryptionService in project oxAuth by GluuFederation.
the class AppInitializer method preparePersistanceProperties.
protected Properties preparePersistanceProperties() {
PersistenceConfiguration persistenceConfiguration = this.configurationFactory.getPersistenceConfiguration();
FileConfiguration persistenceConfig = persistenceConfiguration.getConfiguration();
Properties connectionProperties = (Properties) persistenceConfig.getProperties();
EncryptionService securityService = encryptionServiceInstance.get();
Properties decryptedConnectionProperties = securityService.decryptAllProperties(connectionProperties);
return decryptedConnectionProperties;
}
Aggregations