AWS Encryption SDK for C v2.4
|
Functions | |
int | aws_cryptosdk_enc_ctx_init (struct aws_allocator *alloc, struct aws_hash_table *enc_ctx) |
void | aws_cryptosdk_enc_ctx_clear (struct aws_hash_table *enc_ctx) |
void | aws_cryptosdk_enc_ctx_clean_up (struct aws_hash_table *enc_ctx) |
int | aws_cryptosdk_enc_ctx_clone (struct aws_allocator *alloc, struct aws_hash_table *dest, const struct aws_hash_table *src) |
The encryption context is a string-to-string map of contextual information that is cryptographically bound to the message. We represent the encryption context as an aws_hash_table mapping from aws_string * to aws_string *; for the most part, aws_hash_table methods are used to manipulate these structures, but we provide some higher-level helper methods in this section. These helpers will mostly be of interest to developers of custom CMMs or keyrings.
void aws_cryptosdk_enc_ctx_clean_up | ( | struct aws_hash_table * | enc_ctx | ) |
void aws_cryptosdk_enc_ctx_clear | ( | struct aws_hash_table * | enc_ctx | ) |
int aws_cryptosdk_enc_ctx_clone | ( | struct aws_allocator * | alloc, |
struct aws_hash_table * | dest, | ||
const struct aws_hash_table * | src ) |
Copies the contents of the 'src' encryption context into the 'dest' encryption context. 'dest' must be pre-allocated.
This method will reuse pre-existing entries in dest that match the values in src, and will also reuse aws_strings with a NULL allocator in src. Any other values will be copied into newly allocated memory using the given allocator.
If this function returns an error, the contents of dest are unspecified, but are in a state where aws_cryptosdk_enc_ctx_clear or aws_cryptosdk_enc_ctx_clean_up can be safely used without leaking memory.
int aws_cryptosdk_enc_ctx_init | ( | struct aws_allocator * | alloc, |
struct aws_hash_table * | enc_ctx ) |
Initialize an encryption context, which is just an AWS hash table that uses AWS strings as keys and values. The hash table will call aws_string_destroy to destroy keys and values on destruction of the hash table itself.
See aws/common/hash_table.h for the interface to AWS hash tables, and aws/common/string.h for the interface to AWS strings.