ESAPI-C 1.0
The OWASP Enterprise Security API for C
|
Encrypted Properties module header. More...
Go to the source code of this file.
Data Structures | |
struct | Map_t |
A hashable key-value pair for an access reference map. More... | |
Defines | |
#define | MAX_PROPERTY_LINE_LENGTH 4096 |
The EncryptedProperties module represents a properties file where all the data is encrypted before it is added, and decrypted when it retrieved. | |
#define | KEY_LEN 64 |
The maximum allowed size for a property key. | |
Typedefs | |
typedef struct Map_t | map_t |
A hashable key-value pair. | |
Functions | |
char * | get_property (map_t *, struct esapi_ctx *, const char *) |
Get the plaintext property value for the given key from the given encrypted properties map. | |
char * | get_property_or_default (map_t *, struct esapi_ctx *, const char *, const char *) |
Get the plaintext property value for the given key from the given encrypted properties map. | |
char * | set_property (map_t **, struct esapi_ctx *, const char *, const char *) |
Set the given property key-value pair in the given encrypted properties map. | |
char ** | keys (map_t *) |
Get a list of all keys in the given encrypted properties map. | |
map_t * | load_properties (const char *) |
Read encrypted properties from the given file. | |
void | store_properties (map_t *, const char *) |
Write encrypted properties to the given file. |
Encrypted Properties module header.
Definition in file properties.h.
#define MAX_PROPERTY_LINE_LENGTH 4096 |
The EncryptedProperties module represents a properties file where all the data is encrypted before it is added, and decrypted when it retrieved.
This interface can be implemented in a number of ways, the simplest being wrapping some hashing container library and overloading the behavior of the getProperty() and setProperty() functions. In all cases, the master encryption key is given by the Encryptor.MasterKey property in ESAPI.properties file.
Definition at line 23 of file properties.h.
Referenced by load_properties(), and store_properties().
Get the plaintext property value for the given key from the given encrypted properties map.
The property value is Base64 decoded and decrypted for the caller.
Definition at line 38 of file properties.c.
References esapi_decrypt(), and esapi_log_error().
Referenced by get_property_or_default().
Get the plaintext property value for the given key from the given encrypted properties map.
If the property is not found, return the given default value.
Definition at line 58 of file properties.c.
References get_property().
char** keys | ( | map_t * | ) |
Get a list of all keys in the given encrypted properties map.
Definition at line 105 of file properties.c.
References keys().
Referenced by keys().
map_t* load_properties | ( | const char * | ) |
Read encrypted properties from the given file.
Definition at line 134 of file properties.c.
References MAX_PROPERTY_LINE_LENGTH.
Set the given property key-value pair in the given encrypted properties map.
The value is encrypted and Base64 encoded before it is added to the map.
Definition at line 69 of file properties.c.
References esapi_encrypt(), and esapi_log_error().