|
1 | 1 | # AWS Encryption SDK for Javascript Node.js examples
|
2 | 2 |
|
3 | 3 | 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. |
5 | 5 |
|
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*. |
9 | 7 |
|
10 | 8 | ## KMS Simple
|
11 | 9 |
|
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. |
14 | 11 |
|
15 | 12 | ## KMS Stream
|
16 | 13 |
|
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. |
18 | 15 |
|
19 | 16 | ## KMS Regional Discovery
|
20 | 17 |
|
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. |
26 | 19 |
|
27 | 20 | ## RSA Simple
|
28 | 21 |
|
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. |
0 commit comments