本文整理汇总了Java中org.jasypt.properties.EncryptableProperties类的典型用法代码示例。如果您正苦于以下问题:Java EncryptableProperties类的具体用法?Java EncryptableProperties怎么用?Java EncryptableProperties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EncryptableProperties类属于org.jasypt.properties包,在下文中一共展示了EncryptableProperties类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSecurePassword
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
private String getSecurePassword(String masterPassword) throws IOException {
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword(masterPassword);
Properties props = new EncryptableProperties(encryptor);
props.load(this.getClass().getClassLoader().getResourceAsStream("config/application-mysql.properties"));
return props.getProperty("db.password");
}
开发者ID:ShiftLeftSecurity,项目名称:HelloShiftLeft,代码行数:8,代码来源:DataLoader.java
示例2: wrapEncryption
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
protected static Properties wrapEncryption(final Properties dbProps) throws IOException {
final EncryptionSecretKeyChecker checker = new EncryptionSecretKeyChecker();
checker.check(dbProps);
if (EncryptionSecretKeyChecker.useEncryption()) {
return dbProps;
} else {
final EncryptableProperties encrProps = new EncryptableProperties(EncryptionSecretKeyChecker.getEncryptor());
encrProps.putAll(dbProps);
return encrProps;
}
}
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:13,代码来源:DbProperties.java
示例3: LogServer
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
public LogServer(){
Client client = ClientBuilder.newClient();
client.property(ClientProperties.CONNECT_TIMEOUT, 1000);
client.property(ClientProperties.READ_TIMEOUT, 1000);
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword("jasypt");
this.props = new EncryptableProperties(encryptor);
getPropFile();
HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic(props.getProperty("logstash.username"), props.getProperty("logstash.password"));
client.register(feature);
this.target = client.target(props.getProperty("logstash.url"));
}
开发者ID:vcu-swim-lab,项目名称:stack-intheflow,代码行数:13,代码来源:LogServer.java
示例4: loadProps
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
public static void loadProps() {
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword(DECRYPT_PASS);
properties = new EncryptableProperties(encryptor);
try {
File configFile = getAppConfigFile();
if (configFile != null) {
try (InputStreamReader isr = new InputStreamReader(new FileInputStream(configFile), "UTF-8")) {
properties.load(isr);
}
} else {
InputStream propStreams = Thread.currentThread().getContextClassLoader().getResourceAsStream(RESOURCE_PROPERTIES);
if (propStreams == null) {
// Probably we are running testing
InputStream propStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("default-mycollab-test.properties");
if (propStream != null) {
try (InputStreamReader isr = new InputStreamReader(propStream, "UTF-8")) {
properties.load(isr);
}
}
}
}
} catch (Exception e) {
throw new MyCollabException(e);
}
}
开发者ID:MyCollab,项目名称:mycollab,代码行数:29,代码来源:ApplicationProperties.java
示例5: wrapEncryption
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
protected static Properties wrapEncryption(Properties dbProps) throws IOException {
EncryptionSecretKeyChecker checker = new EncryptionSecretKeyChecker();
checker.check(dbProps);
if (EncryptionSecretKeyChecker.useEncryption()) {
return dbProps;
} else {
EncryptableProperties encrProps = new EncryptableProperties(EncryptionSecretKeyChecker.getEncryptor());
encrProps.putAll(dbProps);
return encrProps;
}
}
开发者ID:apache,项目名称:cloudstack,代码行数:13,代码来源:DbProperties.java
示例6: getDbProperties
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
public synchronized static Properties getDbProperties() {
if (!loaded) {
Properties dbProps = new Properties();
InputStream is = null;
try {
final File props = PropertiesUtil.findConfigFile("db.properties");
if (props != null && props.exists()) {
is = new FileInputStream(props);
}
if (is == null) {
is = PropertiesUtil.openStreamFromURL("db.properties");
}
if (is == null) {
System.err.println("Failed to find db.properties");
log.error("Failed to find db.properties");
}
if (is != null) {
dbProps.load(is);
}
final EncryptionSecretKeyChecker checker = new EncryptionSecretKeyChecker();
checker.check(dbProps);
if (EncryptionSecretKeyChecker.useEncryption()) {
final StandardPBEStringEncryptor encryptor = EncryptionSecretKeyChecker.getEncryptor();
final EncryptableProperties encrDbProps = new EncryptableProperties(encryptor);
encrDbProps.putAll(dbProps);
dbProps = encrDbProps;
}
} catch (final IOException e) {
throw new IllegalStateException("Failed to load db.properties", e);
} finally {
IOUtils.closeQuietly(is);
}
properties = dbProps;
loaded = true;
}
return properties;
}
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:45,代码来源:DbProperties.java
示例7: getDbProperties
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
public synchronized static Properties getDbProperties() {
if (!loaded) {
Properties dbProps = new Properties();
InputStream is = null;
try {
File props = PropertiesUtil.findConfigFile("db.properties");
if (props != null && props.exists()) {
is = new FileInputStream(props);
}
if (is == null) {
is = PropertiesUtil.openStreamFromURL("db.properties");
}
if (is == null) {
System.err.println("Failed to find db.properties");
log.error("Failed to find db.properties");
}
if (is != null) {
dbProps.load(is);
}
EncryptionSecretKeyChecker checker = new EncryptionSecretKeyChecker();
checker.check(dbProps);
if (EncryptionSecretKeyChecker.useEncryption()) {
StandardPBEStringEncryptor encryptor = EncryptionSecretKeyChecker.getEncryptor();
EncryptableProperties encrDbProps = new EncryptableProperties(encryptor);
encrDbProps.putAll(dbProps);
dbProps = encrDbProps;
}
} catch (IOException e) {
throw new IllegalStateException("Failed to load db.properties", e);
} finally {
IOUtils.closeQuietly(is);
}
properties = dbProps;
loaded = true;
}
return properties;
}
开发者ID:apache,项目名称:cloudstack,代码行数:45,代码来源:DbProperties.java
示例8: getEncryptedConfiguration
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
/**
* Gets the {@link #encryptedConfiguration}.
*
* @return the {@link #encryptedConfiguration}.
*/
public static EncryptableProperties getEncryptedConfiguration() {
return encryptedConfiguration;
}
开发者ID:BotMill,项目名称:botmill-core,代码行数:9,代码来源:ConfigurationUtils.java
示例9: setEncryptedConfiguration
import org.jasypt.properties.EncryptableProperties; //导入依赖的package包/类
/**
* Sets the {@link #encryptedConfiguration}.
*
* @param encryptedConfiguration
* the new encrypted configuration
*/
public static void setEncryptedConfiguration(EncryptableProperties encryptedConfiguration) {
ConfigurationUtils.encryptedConfiguration = encryptedConfiguration;
}
开发者ID:BotMill,项目名称:botmill-core,代码行数:10,代码来源:ConfigurationUtils.java
注:本文中的org.jasypt.properties.EncryptableProperties类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论