@aws-sdk/client-kms 3.324.0 → 3.325.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -238,6 +238,49 @@ export interface DecryptCommandOutput extends DecryptResponse, __MetadataBearer
238
238
  * // example id: to-decrypt-data-1478281622886
239
239
  * ```
240
240
  *
241
+ * @example To decrypt data with an asymmetric encryption KMS key
242
+ * ```javascript
243
+ * // The following example decrypts data that was encrypted with an asymmetric encryption KMS key. When the KMS encryption key is asymmetric, you must specify the KMS key ID and the encryption algorithm that was used to encrypt the data.
244
+ * const input = {
245
+ * "CiphertextBlob": "<binary data>",
246
+ * "EncryptionAlgorithm": "RSAES_OAEP_SHA_256",
247
+ * "KeyId": "0987dcba-09fe-87dc-65ba-ab0987654321"
248
+ * };
249
+ * const command = new DecryptCommand(input);
250
+ * const response = await client.send(command);
251
+ * /* response ==
252
+ * {
253
+ * "EncryptionAlgorithm": "RSAES_OAEP_SHA_256",
254
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321",
255
+ * "Plaintext": "<binary data>"
256
+ * }
257
+ * *\/
258
+ * // example id: to-decrypt-data-2
259
+ * ```
260
+ *
261
+ * @example To decrypt data for a Nitro enclave
262
+ * ```javascript
263
+ * // The following Decrypt example includes the Recipient parameter with a signed attestation document from an AWS Nitro enclave. Instead of returning the decrypted data in plaintext (Plaintext), the operation returns the decrypted data encrypted by the public key from the attestation document (CiphertextForRecipient).
264
+ * const input = {
265
+ * "CiphertextBlob": "<binary data>",
266
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
267
+ * "Recipient": {
268
+ * "AttestationDocument": "<attestation document>",
269
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
270
+ * }
271
+ * };
272
+ * const command = new DecryptCommand(input);
273
+ * const response = await client.send(command);
274
+ * /* response ==
275
+ * {
276
+ * "CiphertextForRecipient": "<binary data>",
277
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
278
+ * "Plaintext": ""
279
+ * }
280
+ * *\/
281
+ * // example id: to-decrypt-data-for-a-nitro-enclave-2
282
+ * ```
283
+ *
241
284
  */
242
285
  export declare class DecryptCommand extends $Command<DecryptCommandInput, DecryptCommandOutput, KMSClientResolvedConfig> {
243
286
  readonly input: DecryptCommandInput;
@@ -146,6 +146,17 @@ export interface DisconnectCustomKeyStoreCommandOutput extends DisconnectCustomK
146
146
  * // example id: to-disconnect-a-custom-key-store-from-its-cloudhsm-cluster-1628627955156
147
147
  * ```
148
148
  *
149
+ * @example To disconnect a custom key store from its CloudHSM cluster
150
+ * ```javascript
151
+ * // This example disconnects an AWS KMS custom key store from its backing key store. For an AWS CloudHSM key store, it disconnects the key store from its AWS CloudHSM cluster. For an external key store, it disconnects the key store from the external key store proxy that communicates with your external key manager. This operation doesn't return any data. To verify that the custom key store is disconnected, use the <code>DescribeCustomKeyStores</code> operation.
152
+ * const input = {
153
+ * "CustomKeyStoreId": "cks-1234567890abcdef0"
154
+ * };
155
+ * const command = new DisconnectCustomKeyStoreCommand(input);
156
+ * await client.send(command);
157
+ * // example id: to-disconnect-a-custom-key-store-from-its-cloudhsm-cluster-234abcdefABC
158
+ * ```
159
+ *
149
160
  */
150
161
  export declare class DisconnectCustomKeyStoreCommand extends $Command<DisconnectCustomKeyStoreCommandInput, DisconnectCustomKeyStoreCommandOutput, KMSClientResolvedConfig> {
151
162
  readonly input: DisconnectCustomKeyStoreCommandInput;
@@ -236,6 +236,26 @@ export interface EncryptCommandOutput extends EncryptResponse, __MetadataBearer
236
236
  * // example id: to-encrypt-data-1478906026012
237
237
  * ```
238
238
  *
239
+ * @example To encrypt data with an asymmetric encryption KMS key
240
+ * ```javascript
241
+ * // The following example encrypts data with the specified RSA asymmetric KMS key. When you encrypt with an asymmetric key, you must specify the encryption algorithm.
242
+ * const input = {
243
+ * "EncryptionAlgorithm": "RSAES_OAEP_SHA_256",
244
+ * "KeyId": "0987dcba-09fe-87dc-65ba-ab0987654321",
245
+ * "Plaintext": "<binary data>"
246
+ * };
247
+ * const command = new EncryptCommand(input);
248
+ * const response = await client.send(command);
249
+ * /* response ==
250
+ * {
251
+ * "CiphertextBlob": "<binary data>",
252
+ * "EncryptionAlgorithm": "RSAES_OAEP_SHA_256",
253
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321"
254
+ * }
255
+ * *\/
256
+ * // example id: to-encrypt-data-2
257
+ * ```
258
+ *
239
259
  */
240
260
  export declare class EncryptCommand extends $Command<EncryptCommandInput, EncryptCommandOutput, KMSClientResolvedConfig> {
241
261
  readonly input: EncryptCommandInput;
@@ -233,6 +233,30 @@ export interface GenerateDataKeyCommandOutput extends GenerateDataKeyResponse, _
233
233
  * // example id: to-generate-a-data-key-1478912956062
234
234
  * ```
235
235
  *
236
+ * @example To generate a data key pair for a Nitro enclave
237
+ * ```javascript
238
+ * // The following example includes the Recipient parameter with a signed attestation document from an AWS Nitro enclave. Instead of returning a copy of the data key encrypted by the KMS key and a plaintext copy of the data key, GenerateDataKey returns one copy of the data key encrypted by the KMS key (CiphertextBlob) and one copy of the data key encrypted by the public key from the attestation document (CiphertextForRecipient). The operation doesn't return a plaintext data key.
239
+ * const input = {
240
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
241
+ * "KeySpec": "AES_256",
242
+ * "Recipient": {
243
+ * "AttestationDocument": "<attestation document>",
244
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
245
+ * }
246
+ * };
247
+ * const command = new GenerateDataKeyCommand(input);
248
+ * const response = await client.send(command);
249
+ * /* response ==
250
+ * {
251
+ * "CiphertextBlob": "<binary data>",
252
+ * "CiphertextForRecipient": "<binary data>",
253
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
254
+ * "Plaintext": ""
255
+ * }
256
+ * *\/
257
+ * // example id: to-generate-a-data-key-for-a-nitro-enclave-2
258
+ * ```
259
+ *
236
260
  */
237
261
  export declare class GenerateDataKeyCommand extends $Command<GenerateDataKeyCommandInput, GenerateDataKeyCommandOutput, KMSClientResolvedConfig> {
238
262
  readonly input: GenerateDataKeyCommandInput;
@@ -216,6 +216,32 @@ export interface GenerateDataKeyPairCommandOutput extends GenerateDataKeyPairRes
216
216
  * // example id: to-generate-an-rsa-key-pair-for-encryption-and-decryption-1628619376878
217
217
  * ```
218
218
  *
219
+ * @example To generate a data key pair for a Nitro enclave
220
+ * ```javascript
221
+ * // The following example includes the Recipient parameter with a signed attestation document from an AWS Nitro enclave. Instead of returning a plaintext copy of the private data key, GenerateDataKeyPair returns a copy of the private data key encrypted by the public key from the attestation document (CiphertextForRecipient). It returns the public data key (PublicKey) and a copy of private data key encrypted under the specified KMS key (PrivateKeyCiphertextBlob), as usual, but plaintext private data key field (PrivateKeyPlaintext) is null or empty.
222
+ * const input = {
223
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
224
+ * "KeyPairSpec": "RSA_3072",
225
+ * "Recipient": {
226
+ * "AttestationDocument": "<attestation document>",
227
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
228
+ * }
229
+ * };
230
+ * const command = new GenerateDataKeyPairCommand(input);
231
+ * const response = await client.send(command);
232
+ * /* response ==
233
+ * {
234
+ * "CiphertextForRecipient": "<binary data>",
235
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
236
+ * "KeyPairSpec": "RSA_3072",
237
+ * "PrivateKeyCiphertextBlob": "<binary data>",
238
+ * "PrivateKeyPlaintext": "",
239
+ * "PublicKey": "<binary data>"
240
+ * }
241
+ * *\/
242
+ * // example id: to-generate-a-data-key-pair-for-a-nitro-enclave-2
243
+ * ```
244
+ *
219
245
  */
220
246
  export declare class GenerateDataKeyPairCommand extends $Command<GenerateDataKeyPairCommandInput, GenerateDataKeyPairCommandOutput, KMSClientResolvedConfig> {
221
247
  readonly input: GenerateDataKeyPairCommandInput;
@@ -133,6 +133,27 @@ export interface GenerateRandomCommandOutput extends GenerateRandomResponse, __M
133
133
  * // example id: to-generate-random-data-1479163645600
134
134
  * ```
135
135
  *
136
+ * @example To generate random data
137
+ * ```javascript
138
+ * // The following example includes the Recipient parameter with a signed attestation document from an AWS Nitro enclave. Instead of returning a plaintext (unencrypted) byte string, GenerateRandom returns the byte string encrypted by the public key from the enclave's attestation document.
139
+ * const input = {
140
+ * "NumberOfBytes": 1024,
141
+ * "Recipient": {
142
+ * "AttestationDocument": "<attestation document>",
143
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
144
+ * }
145
+ * };
146
+ * const command = new GenerateRandomCommand(input);
147
+ * const response = await client.send(command);
148
+ * /* response ==
149
+ * {
150
+ * "CiphertextForRecipient": "<binary data>",
151
+ * "Plaintext": ""
152
+ * }
153
+ * *\/
154
+ * // example id: to-generate-random-data-2
155
+ * ```
156
+ *
136
157
  */
137
158
  export declare class GenerateRandomCommand extends $Command<GenerateRandomCommandInput, GenerateRandomCommandOutput, KMSClientResolvedConfig> {
138
159
  readonly input: GenerateRandomCommandInput;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kms",
3
3
  "description": "AWS SDK for JavaScript Kms Client for Node.js, Browser and React Native",
4
- "version": "3.324.0",
4
+ "version": "3.325.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,33 +21,33 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.321.1",
24
+ "@aws-sdk/client-sts": "3.325.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.321.1",
26
+ "@aws-sdk/credential-provider-node": "3.325.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
30
- "@aws-sdk/middleware-content-length": "3.310.0",
31
- "@aws-sdk/middleware-endpoint": "3.310.0",
32
- "@aws-sdk/middleware-host-header": "3.310.0",
33
- "@aws-sdk/middleware-logger": "3.310.0",
34
- "@aws-sdk/middleware-recursion-detection": "3.310.0",
35
- "@aws-sdk/middleware-retry": "3.310.0",
36
- "@aws-sdk/middleware-serde": "3.310.0",
37
- "@aws-sdk/middleware-signing": "3.310.0",
38
- "@aws-sdk/middleware-stack": "3.310.0",
39
- "@aws-sdk/middleware-user-agent": "3.319.0",
30
+ "@aws-sdk/middleware-content-length": "3.325.0",
31
+ "@aws-sdk/middleware-endpoint": "3.325.0",
32
+ "@aws-sdk/middleware-host-header": "3.325.0",
33
+ "@aws-sdk/middleware-logger": "3.325.0",
34
+ "@aws-sdk/middleware-recursion-detection": "3.325.0",
35
+ "@aws-sdk/middleware-retry": "3.325.0",
36
+ "@aws-sdk/middleware-serde": "3.325.0",
37
+ "@aws-sdk/middleware-signing": "3.325.0",
38
+ "@aws-sdk/middleware-stack": "3.325.0",
39
+ "@aws-sdk/middleware-user-agent": "3.325.0",
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.321.1",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.316.0",
43
+ "@aws-sdk/smithy-client": "3.325.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.316.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.316.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.325.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.325.0",
51
51
  "@aws-sdk/util-endpoints": "3.319.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",