|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.api.core.security.AbstractPropertyValueSecurity de.smartics.properties.api.core.security.SystemPropertyBasedPropertyValueSecurity
public class SystemPropertyBasedPropertyValueSecurity
Implementation fetching security information from system properties.
Field Summary | |
---|---|
static String |
SECURITY_ALGORITHM The key with which the algorithm to construct the security key is stored in the system properties. |
static String |
SECURITY_KEY The key with which the security key is stored in the system properties. |
static String |
SECURITY_PROVIDER The key with which the security provider to encrypt and decrypt property values is stored in the system properties. |
static String |
SECURITY_TRANSFORMATION The key with which the transformation to encrypt and decrypt property values is stored in the system properties. |
Constructor Summary | |
---|---|
SystemPropertyBasedPropertyValueSecurity() |
Method Summary | |
---|---|
protected Cipher |
createCipher(PropertyDescriptor descriptor) Creates the cipher instance. |
protected SecretKey |
createKey(PropertyDescriptor descriptor) Creates the symmetric key instance. |
String |
decrypt(PropertyDescriptor descriptor, String encryptedValue) Decrypts the given property value. |
String |
encrypt(PropertyDescriptor descriptor, String plainValue) Encrypts the given property value. |
Methods inherited from class de.smartics.properties.api.core.security.AbstractPropertyValueSecurity |
---|
decodePropertyValue, decrypt, encodePropertyValue, encrypt |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SECURITY_KEY
The value of this constant is "de.smartics.properties.security.key".
"de.smartics.properties.security.key"
public static final String SECURITY_ALGORITHM
A sample value is AES
.
The value of this constant is "de.smartics.properties.security.algorithm".
"de.smartics.properties.security.algorithm"
public static final String SECURITY_PROVIDER
The value of this constant is "de.smartics.properties.security.provider".
"de.smartics.properties.security.provider"
public static final String SECURITY_TRANSFORMATION
A sample value is AES/ECB/PKCS5Padding
.
The value of this constant is "de.smartics.properties.security.transformation".
"de.smartics.properties.security.transformation"
Constructor Detail |
---|
public SystemPropertyBasedPropertyValueSecurity()
Method Detail |
---|
public String decrypt(PropertyDescriptor descriptor, String encryptedValue) throws NullPointerException, SecurityException
PropertyValueSecurity
descriptor
- the descriptor of the property.
encryptedValue
- the encrypted value of the property to be decrypted.
NullPointerException
- may be thrown if
descriptor
is
null
.
SecurityException
- if the value cannot be decrypted.
public String encrypt(PropertyDescriptor descriptor, String plainValue) throws NullPointerException, SecurityException
PropertyValueSecurity
descriptor
- the descriptor of the property.
plainValue
- the plain value of the property to be encrypted.
NullPointerException
- may be thrown if
descriptor
is
null
.
SecurityException
- if the value cannot be encrypted.
protected Cipher createCipher(PropertyDescriptor descriptor) throws SecurityException
descriptor
- the descriptor of the property whose value is to be secured.
SecurityException
- on any problem creating the cipher instance.
protected SecretKey createKey(PropertyDescriptor descriptor) throws SecurityException
descriptor
- the descriptor of the property whose value is to be secured.
SecurityException
- on any problem creating the symmetric key instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |