Skip to content

Commit df5f9cf

Browse files
(DOCSP-24822) Remove OpenSSL from In Use Enc Tuts (#2046)
* wip add new code snippets * add updates to most samples * additional comments * update tabs, add links to sample apps * remove openssl from installation requirements * clarify when openssl is required in gcp and kmip bash commands * add missing open ssl link * add bash commands * test powershell command * proofread * nl - feedback
1 parent d7b5ae3 commit df5f9cf

File tree

31 files changed

+324
-33
lines changed

31 files changed

+324
-33
lines changed

source/core/csfle/install.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ in your development environment:
2727

2828
- Install :manual:`MongoDB Enterprise Edition version 4.2 or later </installation/#mongodb-enterprise-edition-installation-tutorials>`.
2929
- Install a :ref:`MongoDB Driver Compatible with CSFLE <csfle-driver-compatibility>`.
30-
- Install `OpenSSL <https://www.openssl.org/source/>`__ *optional*.
3130
- Start a
3231
:manual:`MongoDB instance </tutorial/manage-mongodb-processes/#start-mongod-processes>`
3332
or

source/core/csfle/quick-start.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,40 @@ Procedure
9494

9595
.. include:: /includes/quick-start/cmk.rst
9696

97+
.. see:: Complete Code
98+
99+
.. tabs-drivers::
100+
101+
.. tab::
102+
:tabid: java-sync
103+
104+
To view the complete code for making a {+cmk-long+}, see
105+
`our Github repository <{+sample-app-url-csfle+}/java/local/reader/src/main/java/com/mongodb/csfle/MakeDataKey.java>`__.
106+
107+
.. tab::
108+
:tabid: nodejs
109+
110+
To view the complete code for making a {+cmk-long+}, see
111+
`our Github repository <{+sample-app-url-csfle+}/node/local/reader/make_data_key.js>`__.
112+
113+
.. tab::
114+
:tabid: python
115+
116+
To view the complete code for making a {+cmk-long+}, see
117+
`our Github repository <{+sample-app-url-csfle+}/python/local/reader/make_data_key.py>`__.
118+
119+
.. tab::
120+
:tabid: csharp
121+
122+
To view the complete code for making a {+cmk-long+}, see
123+
`our Github repository <{+sample-app-url-csfle+}/dotnet/local/reader/CSFLE/MakeDataKey.cs>`__.
124+
125+
.. tab::
126+
:tabid: go
127+
128+
To view the complete code for making a {+cmk-long+}, see
129+
`our Github repository <{+sample-app-url-csfle+}/go/local/reader/make-data-key.go>`__.
130+
97131
.. step:: Create a Unique Index on your {+key-vault-long+}
98132

99133
.. include:: /includes/quick-start/key-vault-index.rst

source/core/queryable-encryption/install.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ in your development environment:
2727

2828
- Download the :ref:`{+shared-library+} <qe-reference-shared-library-download>`.
2929
- Install a :ref:`MongoDB Driver Compatible with {+qe+} <qe-driver-compatibility>`.
30-
- Install `OpenSSL <https://www.openssl.org/source/>`__ *optional*.
3130
- Start an
3231
:atlas:`Atlas Cluster </getting-started?jmp=docs>`
3332
or a

source/core/queryable-encryption/quick-start.txt

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,46 @@ Procedure
8989

9090
.. include:: /includes/queryable-encryption/quick-start/cmk.rst
9191

92+
.. see:: Complete Code
93+
94+
.. tabs-drivers::
95+
96+
.. tab::
97+
:tabid: shell
98+
99+
To view the complete code for making a {+cmk-long+}, see
100+
`our Github repository <{+sample-app-url-qe+}/mongosh/local/reader/make_data_key.js>`__.
101+
102+
.. tab::
103+
:tabid: nodejs
104+
105+
To view the complete code for making a {+cmk-long+}, see
106+
`our Github repository <{+sample-app-url-qe+}/node/local/reader/make_data_key.js>`__.
107+
108+
.. tab::
109+
:tabid: python
110+
111+
To view the complete code for making a {+cmk-long+}, see
112+
`our Github repository <{+sample-app-url-qe+}/python/local/reader/make_data_key.py>`__.
113+
114+
.. tab::
115+
:tabid: java-sync
116+
117+
To view the complete code for making a {+cmk-long+}, see
118+
`our Github repository <{+sample-app-url-qe+}/java/local/reader/src/main/java/com/mongodb/qe/MakeDataKey.java>`__.
119+
120+
.. tab::
121+
:tabid: go
122+
123+
To view the complete code for making a {+cmk-long+}, see
124+
`our Github repository <{+sample-app-url-qe+}/go/local/reader/make-data-key.go>`__.
125+
126+
.. tab::
127+
:tabid: csharp
128+
129+
To view the complete code for making a {+cmk-long+}, see
130+
`our Github repository <{+sample-app-url-qe+}/dotnet/local/reader/QueryableEncryption/MakeDataKey.cs>`__.
131+
92132
.. step:: Create a Unique Index on your {+key-vault-long+}
93133

94134
.. include:: /includes/queryable-encryption/quick-start/key-vault-index.rst
@@ -137,7 +177,6 @@ Procedure
137177
To view the complete code for making a {+dek-long+}, see
138178
`our Github repository <{+sample-app-url-qe+}/dotnet/local/reader/QueryableEncryption/MakeDataKey.cs>`__.
139179

140-
141180
.. step:: Configure your MongoClient for Encrypted Reads and Writes
142181

143182
.. include:: /includes/queryable-encryption/quick-start/client.rst

source/core/queryable-encryption/tutorials/explicit-encryption.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,40 @@ Procedure
7676

7777
.. include:: /includes/queryable-encryption/tutorials/exp/cmk.rst
7878

79+
.. see:: Complete Code
80+
81+
.. tabs-drivers::
82+
83+
.. tab::
84+
:tabid: nodejs
85+
86+
To view the complete code for making a {+cmk-long+}, see
87+
`the {+qe+} sample application repository <{+sample-app-url-qe+}/node/exp/reader/make_data_key.js>`__.
88+
89+
.. tab::
90+
:tabid: python
91+
92+
To view the complete code for making a {+cmk-long+}, see
93+
`the {+qe+} sample application repository <{+sample-app-url-qe+}/python/exp/reader/make_data_key.py>`__.
94+
95+
.. tab::
96+
:tabid: java-sync
97+
98+
To view the complete code for making a {+cmk-long+}, see
99+
`the {+qe+} sample application repository <{+sample-app-url-qe+}/java/exp/reader/src/main/java/com/mongodb/qe/MakeDataKey.java>`__.
100+
101+
.. tab::
102+
:tabid: go
103+
104+
To view the complete code for making a {+cmk-long+}, see
105+
`the {+qe+} sample application repository <{+sample-app-url-qe+}/go/exp/reader/make-data-key.go>`__.
106+
107+
.. tab::
108+
:tabid: csharp
109+
110+
To view the complete code for making a {+cmk-long+}, see
111+
`the {+qe+} sample application repository <{+sample-app-url-qe+}/dotnet/exp/reader/QueryableEncryption/MakeDataKey.cs>`__.
112+
79113
.. step:: Create a Unique Index on your {+key-vault-long+}
80114

81115
.. include:: /includes/queryable-encryption/tutorials/exp/key-vault-index.rst

source/includes/generated/in-use-encryption/csfle/dotnet/local/reader/CSFLE/MakeDataKey.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public static void MakeKey()
1515
{
1616

1717

18+
// start-local-cmk
1819
using (var randomNumberGenerator = System.Security.Cryptography.RandomNumberGenerator.Create())
1920
{
2021
var bytes = new byte[96];
@@ -23,6 +24,7 @@ public static void MakeKey()
2324
Console.WriteLine(localMasterKeyBase64Write);
2425
File.WriteAllText("master-key.txt", localMasterKeyBase64Write);
2526
}
27+
// end-local-cmk
2628

2729
// start-kmsproviders
2830
var kmsProviders = new Dictionary<string, IReadOnlyDictionary<string, object>>();

source/includes/generated/in-use-encryption/csfle/go/local/reader/make-data-key.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"io/ioutil"
1717
)
1818

19+
// start-local-cmk
1920
func localMasterKey() []byte {
2021
key := make([]byte, 96)
2122
if _, err := rand.Read(key); err != nil {
@@ -27,6 +28,8 @@ func localMasterKey() []byte {
2728
return key
2829
}
2930

31+
// end-local-cmk
32+
3033
func MakeKey() error {
3134

3235
localMasterKey()

source/includes/generated/in-use-encryption/csfle/java/local/reader/src/main/java/com/mongodb/csfle/MakeDataKey.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@
5252
public class MakeDataKey {
5353

5454
public static void main(String[] args) throws Exception {
55+
// start-local-cmk
5556
byte[] localMasterKeyWrite = new byte[96];
5657
new SecureRandom().nextBytes(localMasterKeyWrite);
5758
try (FileOutputStream stream = new FileOutputStream("master-key.txt")) {
5859
stream.write(localMasterKeyWrite);
5960
}
61+
// end-local-cmk
6062

6163
// start-kmsproviders
6264
String kmsProvider = "local";

source/includes/generated/in-use-encryption/csfle/node/local/reader/make_data_key.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ const mongodb = require("mongodb");
22
const { ClientEncryption } = require("mongodb-client-encryption");
33
const { MongoClient, Binary } = mongodb;
44

5+
// start-local-cmk
56
const fs = require("fs");
67
const crypto = require("crypto");
78
try {
89
fs.writeFileSync("master-key.txt", crypto.randomBytes(96));
910
} catch (err) {
1011
console.error(err);
1112
}
13+
// end-local-cmk
1214

1315
// start-kmsproviders
1416
const provider = "local";

source/includes/generated/in-use-encryption/csfle/python/local/reader/make_data_key.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
from bson.codec_options import CodecOptions
77
from bson.binary import STANDARD, UUID
88

9+
# start-local-cmk
910
import os
1011

1112
path = "master-key.txt"
1213
file_bytes = os.urandom(96)
1314
with open(path, "wb") as f:
1415
f.write(file_bytes)
16+
# end-local-cmk
1517

1618
# start-kmsproviders
1719
path = "./master-key.txt"

0 commit comments

Comments
 (0)