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 tutorial you'll learn how to use the Secret manager to store the encryption key used with [SSE-C](/object-storage/api-cli/enable-sse-c/).
19
+
In this tutorial you will learn how to use the Secret manager to store the encryption key used with [SSE-C](/object-storage/api-cli/enable-sse-c/).
20
20
21
21
<Requirements />
22
22
@@ -25,11 +25,11 @@ In this tutorial you'll learn how to use the Secret manager to store the encrypt
25
25
- An [Object Storage bucket](/object-storage/how-to/create-a-bucket/)
26
26
- Installed and initialized the [AWS CLI](/object-storage/api-cli/object-storage-aws-cli/)
27
27
28
-
The goal here, is to use the Key Manager to generate the encryption key, store the encryption key in the Secret Manager, then use it for Object Storage SSE-C.
28
+
The goal here is to use Key Manager to generate the encryption key, store the encryption key in Secret Manager, then use it to encrypt Object Storage objects SSE-C.
29
29
30
30
### Generating the encryption key
31
31
32
-
With the following commands, you will create a key in the Key Manager, generate the encryption key and then store it in the Secret Manager.
32
+
Run the following commands to create a key in Key Manager, generate the encryption key, then store it in Secret Manager.
@@ -40,7 +40,7 @@ scw secret version create "$SECRET_ID" data="@ssec.key"
40
40
41
41
### Encryption key and digest preparation
42
42
43
-
First you access the secret version to get the encryption key, then you need to encode it to base64 and calculate the digest of the key, also encoded in base64.
43
+
Run the following command to access the secret version to get the encryption key, encode it to base64, calculate the digest of the key (also encoded in base64), and store the outputs in environment variables.
44
44
45
45
```bash
46
46
scw secret version access "$SECRET_ID" revision=latest raw=true > ssec.key
@@ -54,26 +54,26 @@ If you delete the secret containing the encryption key, you also lose the data e
54
54
55
55
### Upload and download object with SSE-C
56
56
57
-
Run the command below to upload an object and encrypt it. Make sure to replace `<your-bucket-name>`, `<your-object-key>`, and `<path/to/your/file>` with the correct values.
58
-
59
-
```bash
60
-
aws s3api put-object \
61
-
--bucket <your-bucket-name> \
62
-
--key <your-object-key> \
63
-
--body <path/to/your/file> \
64
-
--sse-customer-algorithm AES256 \
65
-
--sse-customer-key $ENCRYPTION_KEY \
66
-
--sse-customer-key-md5 $KEY_DIGEST
67
-
```
68
-
69
-
Run the command below to download the previously uploaded object and decrypt it. Make sure to replace `<your-bucket-name>`, `<your-object-key>`, and `<path/to/destination/file>` with the correct values.
70
-
71
-
```bash
72
-
aws s3api get-object \
73
-
--bucket <your-bucket-name> \
74
-
--key <your-object-key> \
75
-
<path/to/destination/file> \
76
-
--sse-customer-algorithm AES256 \
77
-
--sse-customer-key $ENCRYPTION_KEY \
78
-
--sse-customer-key-md5 $KEY_DIGEST
79
-
```
57
+
1.Run the command below to upload an object and encrypt it. Make sure to replace `<your-bucket-name>`, `<your-object-key>`, and `<path/to/your/file>` with the correct values.
58
+
59
+
```bash
60
+
aws s3api put-object \
61
+
--bucket <your-bucket-name> \
62
+
--key <your-object-key> \
63
+
--body <path/to/your/file> \
64
+
--sse-customer-algorithm AES256 \
65
+
--sse-customer-key $ENCRYPTION_KEY \
66
+
--sse-customer-key-md5 $KEY_DIGEST
67
+
```
68
+
69
+
2.Run the command below to download the previously uploaded object and decrypt it. Make sure to replace `<your-bucket-name>`, `<your-object-key>`, and `<path/to/destination/file>` with the correct values.
0 commit comments