You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, we create a regular `dynamodb.Client`, a key material store, and a cryptographic materials provider. Then, we create an `EncryptedClient` instance with custom attribute actions to specify which attributes should be encrypted. Finally, we use the `EncryptedClient` to perform operations like PutItem, and the library automatically handles the encryption and decryption of sensitive data.
84
+
Encrypting and Decrypting Items
85
+
86
+
With the EncryptedClient, you can perform various DynamoDB operations on encrypted items:
The EncryptedClient transparently encrypts and decrypts items based on the specified encryption options in the ClientConfig. It also handles the storage and retrieval of metadata using the MetaStore.
123
+
124
+
## MetaStore
125
+
126
+
The MetaStore is responsible for storing and retrieving metadata associated with encrypted items. It uses a separate DynamoDB table to store the metadata, which includes the encrypted data keys and other relevant information.
127
+
128
+
When an item is encrypted, the EncryptedClient generates a unique material name based on the item's primary key and stores the encrypted data key and metadata in the MetaStore. When decrypting an item, the EncryptedClient retrieves the corresponding metadata from the MetaStore to obtain the necessary decryption materials.
129
+
130
+
The MetaStore provides the following key functions:
131
+
132
+
-**StoreNewMaterial**: Stores new encryption metadata for an item.
133
+
-**RetrieveMaterial**: Retrieves the encryption metadata for an item based on its material name and version.
134
+
-**CreateTableIfNotExists**: Creates the metadata table if it doesn't exist.
95
135
96
-
For more detailed examples and usage instructions, please refer to the documentation and the examples directory in the repository.
136
+
The MetaStore ensures that the encryption metadata is securely stored and can be accessed efficiently during encryption and decryption operations.
0 commit comments