|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.owasp.esapi.EncryptedProperties
Reference implementation of the IEncryptedProperties interface. This implementation wraps a normal properties file, and creates surrogates for the getProperty and setProperty methods that perform encryption and decryption based on the Encryptor. A very simple main program is provided that can be used to create an encrypted properties file. A better approach would be to allow unencrypted properties in the file and to encrypt them the first time the file is accessed.
IEncryptedProperties| Constructor Summary | |
EncryptedProperties()
Instantiates a new encrypted properties. |
|
| Method Summary | |
java.lang.String |
getProperty(java.lang.String key)
Gets the property value from the encrypted store, decrypts it, and returns the plaintext value to the caller. |
java.util.Set |
keySet()
Key set. |
void |
load(java.io.InputStream in)
Load. |
static void |
main(java.lang.String[] args)
The main method. |
java.lang.String |
setProperty(java.lang.String key,
java.lang.String value)
Encrypts the plaintext property value and stores the ciphertext value in the encrypted store. |
void |
store(java.io.OutputStream out,
java.lang.String comments)
Store. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public EncryptedProperties()
| Method Detail |
public java.lang.String getProperty(java.lang.String key)
throws EncryptionException
IEncryptedProperties
getProperty in interface IEncryptedPropertieskey - the key
EncryptionException - the encryption exception
public java.lang.String setProperty(java.lang.String key,
java.lang.String value)
throws EncryptionException
IEncryptedProperties
setProperty in interface IEncryptedPropertieskey - the keyvalue - the value
EncryptionException - the encryption exceptionpublic java.util.Set keySet()
public void load(java.io.InputStream in)
throws java.io.IOException
in - the in
java.io.IOException - Signals that an I/O exception has occurred.
public void store(java.io.OutputStream out,
java.lang.String comments)
throws java.io.IOException
out - the outcomments - the comments
java.io.IOException - Signals that an I/O exception has occurred.
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - the arguments
java.lang.Exception - the exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||