public class SecuredPropertiesConfig extends Object implements Config
SecuredProperties
.Constructor and Description |
---|
SecuredPropertiesConfig() |
Modifier and Type | Method and Description |
---|---|
SecuredPropertiesConfig |
addAllowedAlgorithm(Algorithm... addedAllowedAlgorithm) |
Algorithm[] |
getAllowedAlgorithm() |
int |
getSaltLength() |
File |
getSecretFile()
Return the SecretFile location which is needed to decrypt and encrypt your property-values.
|
SecuredPropertiesConfig |
init(ConfigInitializer... configInitializers)
The generic variant of
initDefault() . |
SecuredPropertiesConfig |
initDefault()
Similar to Spring-Boot, Externalize your configuration so that you can work with the same application code in different environments.
|
boolean |
isAutoCreateSecretKey() |
SecuredPropertiesConfig |
withAllowedAlgorithm(Algorithm... newAllowedAlgorithm) |
SecuredPropertiesConfig |
withAutoCreateSecretKey(boolean autoCreate) |
SecuredPropertiesConfig |
withSaltLength(int newSaltLength) |
SecuredPropertiesConfig |
withSecretFile(File newSecretFile)
Overwrite the default location "%user_home%/.secret/securedProperties.key" for the secret key to encrypt and decrypt values.
|
public File getSecretFile()
Default is $HOME/.secret/securedProperties.key
public int getSaltLength()
public boolean isAutoCreateSecretKey()
public Algorithm[] getAllowedAlgorithm()
public SecuredPropertiesConfig initDefault()
The Properties which can be configured can be found in ConfigKey
.
The default prefix is "SECURED_PROPERTIES" and the keys must be configured formatted as:
public SecuredPropertiesConfig init(ConfigInitializer... configInitializers)
initDefault()
. Just put your ConfigInitializer
s into it in the order you want.
The last one has the highest priority and will overwrite properties before.
configInitializers
- your ConfigInitializer
s. See ConfigInitializers
.public SecuredPropertiesConfig withSecretFile(File newSecretFile)
withSecretFile
in interface Config
newSecretFile
- the secret Filepublic SecuredPropertiesConfig withSaltLength(int newSaltLength)
withSaltLength
in interface Config
public SecuredPropertiesConfig withAllowedAlgorithm(Algorithm... newAllowedAlgorithm)
withAllowedAlgorithm
in interface Config
public SecuredPropertiesConfig addAllowedAlgorithm(Algorithm... addedAllowedAlgorithm)
public SecuredPropertiesConfig withAutoCreateSecretKey(boolean autoCreate)
withAutoCreateSecretKey
in interface Config
Copyright © 2016–2019 Brabenetz Harald, Austria. All rights reserved.