Use relaxed property resolver in KeyCondition

Allows users to define properties like encrypt.key-store.password=letmein

fixes gh-191

(cherry picked from commit 7744b63)
This commit is contained in:
Spencer Gibb
2017-04-03 21:49:39 -06:00
parent 61199a151c
commit 78d10fc223
2 changed files with 21 additions and 5 deletions

View File

@@ -19,6 +19,20 @@ public class EncryptionBootstrapConfigurationTests {
.run();
TextEncryptor encryptor = context.getBean(TextEncryptor.class);
assertEquals("foo", encryptor.decrypt(encryptor.encrypt("foo")));
context.close();
}
@Test
public void rsaKeyStoreWithRelaxedProperties() {
ConfigurableApplicationContext context = new SpringApplicationBuilder(
EncryptionBootstrapConfiguration.class).web(false).properties(
"encrypt.key-store.location:classpath:/server.jks",
"encrypt.key-store.password:letmein",
"encrypt.key-store.alias:mytestkey", "encrypt.key-store.secret:changeme")
.run();
TextEncryptor encryptor = context.getBean(TextEncryptor.class);
assertEquals("foo", encryptor.decrypt(encryptor.encrypt("foo")));
context.close();
}
}