Skip to content

Commit 47b9687

Browse files
example-node Readme.md update
1 parent 74bc06b commit 47b9687

File tree

4 files changed

+16
-61
lines changed

4 files changed

+16
-61
lines changed

modules/example-node/Readme.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
# AWS Encryption SDK for Javascript Node.js examples
22

33
This repository holds examples for encrypt and decrypt in Node.js.
4-
These examples are intended to work so you can experiment with functional code.
4+
These examples are intended to work in such a way that you can experiment with functional code. These are not for production use.
55

6-
# NOTE
7-
The CMK's in these examples *are only* for example. They *are public*.
8-
Replace these CMK's with your own.
6+
> The CMK's in these examples *are only* for example. They *are public*. *Replace these CMK's with your own*.
97
108
## KMS Simple
119

12-
This is the simples example.
13-
It encrypts and decrypts a simple string with KMS.
10+
This is an example of using KMS to encrypt and decrypt a simple string. See `kms_simple.ts` for a more detailed explanation.
1411

1512
## KMS Stream
1613

17-
An example of encrypting a file stream with KMS.
14+
This is an example of using KMS to encrypt and decrypt a file stream. See `kms_stream.ts` for a more detailed explanation.
1815

1916
## KMS Regional Discovery
2017

21-
KMS Keyrings can be put in `discovery` mode.
22-
This means that it will attempt to connect to any region.
23-
This is not always what you want.
24-
Perhapses for performance you want to limit attempts to a set of "close" regions.
25-
Perhapses for policy reason you want to exclude some regions.
18+
KMS Keyrings can be put in `discovery` mode, which means that, on decrypt, it will attempt to connect to any region represented in the KMS Keyring by using the `clientProvider`. However, perhaps for performance, you may want to limit attempts to a set of "close" regions, or, for policy reasons, you want to exclude some regions, which can be done with the `limitRegions` and `excludeRegions` functions, respectively. See `kms_regional_discovery.ts` for a more detailed explanation.
2619

2720
## RSA Simple
2821

29-
Sometimes you may want to use an RSA key to exchange secrets.
30-
This has some advantages, but comes with a heaved key management cost.
31-
If you can use KMS, the context guaranties are generally worth it.
32-
However, I still want to provide an example incase this fits your use case.
22+
This is an example of using RSA to encrypt and decrypt a simple string. This has some advantages for certain use-cases, but the key management costs are higher than using KMS, which means KMS is generally the best option. See `rsa_simple.ts` for a more detailed explanation.
23+
24+
## How to Use
25+
26+
Run `npm test` to see these examples in action.
27+
28+
## License
29+
30+
This SDK is distributed under the
31+
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),
32+
see LICENSE.txt and NOTICE.txt for more information.

modules/example-node/src/kms_regional_discovery.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,6 @@
1313
* limitations under the License.
1414
*/
1515

16-
/*
17-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
18-
*
19-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
20-
* this file except in compliance with the License. A copy of the License is
21-
* located at
22-
*
23-
* http://aws.amazon.com/apache2.0/
24-
*
25-
* or in the "license" file accompanying this file. This file is distributed on an
26-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
27-
* implied. See the License for the specific language governing permissions and
28-
* limitations under the License.
29-
*/
30-
3116
import { KmsKeyringNode, limitRegions, excludeRegions, getKmsClient, decrypt } from '@aws-crypto/client-node'
3217

3318
export async function kmsRegionalDiscoveryLimitTest (ciphertext: string|Buffer) {

modules/example-node/src/kms_simple.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,6 @@
1313
* limitations under the License.
1414
*/
1515

16-
/*
17-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
18-
*
19-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
20-
* this file except in compliance with the License. A copy of the License is
21-
* located at
22-
*
23-
* http://aws.amazon.com/apache2.0/
24-
*
25-
* or in the "license" file accompanying this file. This file is distributed on an
26-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
27-
* implied. See the License for the specific language governing permissions and
28-
* limitations under the License.
29-
*/
30-
3116
import { KmsKeyringNode, encrypt, decrypt } from '@aws-crypto/client-node'
3217

3318
export async function kmsSimpleTest () {

modules/example-node/src/rsa_simple.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,6 @@
1313
* limitations under the License.
1414
*/
1515

16-
/*
17-
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
18-
*
19-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
20-
* this file except in compliance with the License. A copy of the License is
21-
* located at
22-
*
23-
* http://aws.amazon.com/apache2.0/
24-
*
25-
* or in the "license" file accompanying this file. This file is distributed on an
26-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
27-
* implied. See the License for the specific language governing permissions and
28-
* limitations under the License.
29-
*/
30-
3116
import { RawRsaKeyringNode, encrypt, decrypt } from '@aws-crypto/client-node'
3217

3318
import { generateKeyPair } from 'crypto'

0 commit comments

Comments
 (0)