Skip to content

Commit 065d935

Browse files
authored
DOCSP-26098 key rotation QE (#2296)
1 parent e8d59e4 commit 065d935

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

source/core/queryable-encryption/fundamentals/manage-keys.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,42 @@ To learn more about the relationship between keys, see
5050

5151
.. include:: /includes/queryable-encryption/qe-warning-remote-kms.rst
5252

53+
.. _qe-fundamentals-rotate-keys:
54+
55+
Rotate Encryption Keys Using ``mongosh``
56+
----------------------------------------
57+
58+
You can rotate encryption keys using the
59+
:method:`KeyVault.rewrapManyDataKey()` method. The ``rewrapManyDataKey``
60+
method automatically decrypts multiple data keys and re-encrypts them
61+
using a specified {+cmk-long+} (CMK). It then updates the rotated keys
62+
in the key vault collection. This method allows you to rotate encryption
63+
keys based on two optional arguments:
64+
65+
- A filter used to specify which keys to rotate. If no data key matches
66+
the given filter, no keys will be rotated. Omit the filter to rotate
67+
all keys in your key vault collection.
68+
69+
- An object that represents a new CMK. Omit this object to rotate
70+
the data keys using their current CMKs.
71+
72+
The ``rewrapManyDataKey`` method has the following syntax:
73+
74+
.. code-block:: json
75+
76+
let keyVault = db.getMongo().getKeyVault()
77+
78+
keyVault.rewrapManyDataKey(
79+
{
80+
"<Your custom filter>"
81+
},
82+
{
83+
provider: "<KMS provider>",
84+
masterKey: {
85+
"<dataKeyOpts Key>" : "<dataKeyOpts Value>"
86+
}
87+
}
88+
)
5389
Supported Key Management Services
5490
---------------------------------
5591

0 commit comments

Comments
 (0)