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
@javadoc("The DynamoDB client this Key Store uses to call Amazon DynamoDB. If None is provided and the KMS ARN is, the KMS ARN is used to determine the Region of the default client.")
108
127
ddbClient: DdbClientReference,
109
128
@javadoc("The KMS client this Key Store uses to call AWS KMS. If None is provided and the KMS ARN is, the KMS ARN is used to determine the Region of the default client.")
// CreateKey will create two keys to add to the key store
230
250
// One is the branch key, which is used in the hierarchical keyring
231
251
// The second is a beacon key that is used as a root key to
232
252
// derive different beacon keys per beacon.
233
-
@javadoc("Create a new Branch Key in the Key Store. Additionally create a Beacon Key that is tied to this Branch Key.")
253
+
@javadoc(
254
+
"Create a new Branch Key in the Branch Key Store.
255
+
This method ONLY creates hierarchy-version-1 branch keys.
256
+
This creates 3 items: the ACTIVE branch key item, the DECRYPT_ONLY for the ACTIVE branch key item, and the beacon key.
257
+
In DynamoDB, the sort-key for the ACTIVE branch key is 'branch:ACTIVE`;
258
+
the sort-key for the decrypt_only is 'branch:version:<uuid>';
259
+
the sort-key for the beacon key is `beacon:ACTIVE'.
260
+
The active branch key and the decrypt_only items have the same plain-text data key.
261
+
The beacon key plain-text data key is unqiue.
262
+
KMS is called 3 times; GenerateDataKeyWithoutPlaintext is called twice, ReEncrypt is called once.
263
+
All three items are written to DDB by a TransactionWriteItems, conditioned on the absence of a conflicting Branch Key ID.
264
+
See Branch Key Store Developer Guide's 'Create Branch Keys': https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/create-branch-keys.html")
// VersionKey will create a new branch key under the
260
299
// provided branchKeyIdentifier and rotate the "older" material
261
300
// on the key store under the branchKeyIdentifier. This operation MUST NOT
262
301
// rotate the beacon key under the branchKeyIdentifier.
263
-
@javadoc("Create a new ACTIVE version of an existing Branch Key in the Key Store, and set the previously ACTIVE version to DECRYPT_ONLY.")
302
+
@javadoc(
303
+
"Rotates an exsisting Branch Key;
304
+
this generates a fresh AES-256 key which all future encrypts will use
305
+
for the Key Derivation Function,
306
+
until VersionKey is executed again.
307
+
This method ONLY works with hierarchy-version-1 Branch Keys;
308
+
if a hierarchy-version-2 Branch Key is encountered, the operation fails before calling KMS.
309
+
Rotation is accomplished by first authenticating the ACTIVE branch key item via 'kms:ReEncrypt'.
310
+
'kms:GenerateDataKeyWithoutPlaintext', followed by 'kms:ReEncrypt' is used to create a new ACTIVE and matching DECRYPT_ONLY.
311
+
These two items are then writen to the Branch Key Store via a TransactionWriteItems;
312
+
this only overwrites the ACTIVE item, the DECRYPT_ONLY is a new item.
313
+
This leaves all the previous DECRYPT_ONLY items avabile to service decryption of previous rotations.
314
+
See Branch Key Store Developer Guide's 'Rotate your active branch key': https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/rotate-branch-key.html")
Copy file name to clipboardExpand all lines: AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStoreAdmin/Model/AwsCryptographyKeyStoreAdminTypes.dfy
0 commit comments