@@ -68,50 +68,6 @@ content: |
6868 variables in the shell to reference the AWS credentials.
6969
7070 ---
71- ref : csfle-connection-boilerplate
72- content : |
73-
74- Configuring client-side field level encryption for a locally
75- managed key requires specifying a base64-encoded 96-byte
76- string with no line breaks. The following operation generates
77- a key that meets the stated requirements and loads it into
78- :binary:`~bin.mongosh`:
79-
80- .. code-block:: bash
81- :emphasize-lines: 1
82-
83- TEST_LOCAL_KEY=$(echo "$(head -c 96 /dev/urandom | base64 | tr -d '\n')")
84-
85- mongosh --nodb --shell --eval "var TEST_LOCAL_KEY='$TEST_LOCAL_KEY'"
86-
87- Create the client-side field level encryption object using the
88- generated local key string:
89-
90- .. code-block:: javascript
91- :emphasize-lines: 5
92-
93- var autoEncryptionOpts = {
94- "keyVaultNamespace" : "encryption.__dataKeys",
95- "kmsProviders" : {
96- "local" : {
97- "key" : BinData(0, TEST_LOCAL_KEY)
98- }
99- }
100- }
101-
102- Use the :method:`Mongo()` constructor to create a database connection
103- with the client-side field level encryption options. Replace the
104- ``mongodb://myMongo.example.net`` URI with the :ref:`connection string
105- URI <mongodb-uri>` of the target cluster.
106-
107- .. code-block:: javascript
108- :emphasize-lines: 2
109-
110- encryptedClient = Mongo(
111- "mongodb://myMongo.example.net:27017/?replSetName=myMongo",
112- autoEncryptionOpts
113- )
114- ---
11571ref : csfle-enterprise-atlas-only
11672content : |
11773
0 commit comments