@aws-sdk/client-kms 3.324.0 → 3.326.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.
Files changed (51) hide show
  1. package/dist-types/commands/CancelKeyDeletionCommand.d.ts +6 -0
  2. package/dist-types/commands/ConnectCustomKeyStoreCommand.d.ts +4 -0
  3. package/dist-types/commands/CreateAliasCommand.d.ts +4 -0
  4. package/dist-types/commands/CreateCustomKeyStoreCommand.d.ts +7 -1
  5. package/dist-types/commands/CreateGrantCommand.d.ts +7 -0
  6. package/dist-types/commands/CreateKeyCommand.d.ts +52 -1
  7. package/dist-types/commands/DecryptCommand.d.ts +98 -3
  8. package/dist-types/commands/DeleteAliasCommand.d.ts +4 -0
  9. package/dist-types/commands/DeleteCustomKeyStoreCommand.d.ts +4 -0
  10. package/dist-types/commands/DeleteImportedKeyMaterialCommand.d.ts +4 -0
  11. package/dist-types/commands/DescribeCustomKeyStoresCommand.d.ts +27 -1
  12. package/dist-types/commands/DescribeKeyCommand.d.ts +52 -1
  13. package/dist-types/commands/DisableKeyCommand.d.ts +4 -0
  14. package/dist-types/commands/DisableKeyRotationCommand.d.ts +4 -0
  15. package/dist-types/commands/DisconnectCustomKeyStoreCommand.d.ts +16 -1
  16. package/dist-types/commands/EnableKeyCommand.d.ts +4 -0
  17. package/dist-types/commands/EnableKeyRotationCommand.d.ts +4 -0
  18. package/dist-types/commands/EncryptCommand.d.ts +52 -3
  19. package/dist-types/commands/GenerateDataKeyCommand.d.ts +57 -1
  20. package/dist-types/commands/GenerateDataKeyPairCommand.d.ts +63 -1
  21. package/dist-types/commands/GenerateDataKeyPairWithoutPlaintextCommand.d.ts +9 -0
  22. package/dist-types/commands/GenerateDataKeyWithoutPlaintextCommand.d.ts +7 -0
  23. package/dist-types/commands/GenerateMacCommand.d.ts +8 -0
  24. package/dist-types/commands/GenerateRandomCommand.d.ts +49 -1
  25. package/dist-types/commands/GetKeyPolicyCommand.d.ts +6 -0
  26. package/dist-types/commands/GetKeyRotationStatusCommand.d.ts +6 -0
  27. package/dist-types/commands/GetParametersForImportCommand.d.ts +9 -0
  28. package/dist-types/commands/GetPublicKeyCommand.d.ts +16 -0
  29. package/dist-types/commands/ImportKeyMaterialCommand.d.ts +4 -0
  30. package/dist-types/commands/ListAliasesCommand.d.ts +16 -0
  31. package/dist-types/commands/ListGrantsCommand.d.ts +29 -0
  32. package/dist-types/commands/ListKeyPoliciesCommand.d.ts +10 -0
  33. package/dist-types/commands/ListKeysCommand.d.ts +13 -0
  34. package/dist-types/commands/ListResourceTagsCommand.d.ts +13 -0
  35. package/dist-types/commands/ListRetirableGrantsCommand.d.ts +29 -0
  36. package/dist-types/commands/PutKeyPolicyCommand.d.ts +4 -0
  37. package/dist-types/commands/ReEncryptCommand.d.ts +10 -0
  38. package/dist-types/commands/ReplicateKeyCommand.d.ts +58 -0
  39. package/dist-types/commands/RetireGrantCommand.d.ts +4 -0
  40. package/dist-types/commands/RevokeGrantCommand.d.ts +4 -0
  41. package/dist-types/commands/ScheduleKeyDeletionCommand.d.ts +9 -0
  42. package/dist-types/commands/SignCommand.d.ts +8 -0
  43. package/dist-types/commands/TagResourceCommand.d.ts +4 -0
  44. package/dist-types/commands/UntagResourceCommand.d.ts +4 -0
  45. package/dist-types/commands/UpdateAliasCommand.d.ts +4 -0
  46. package/dist-types/commands/UpdateCustomKeyStoreCommand.d.ts +5 -1
  47. package/dist-types/commands/UpdateKeyDescriptionCommand.d.ts +4 -0
  48. package/dist-types/commands/UpdatePrimaryRegionCommand.d.ts +4 -0
  49. package/dist-types/commands/VerifyCommand.d.ts +8 -0
  50. package/dist-types/commands/VerifyMacCommand.d.ts +8 -0
  51. package/package.json +16 -16
@@ -148,6 +148,12 @@ export interface EncryptCommandOutput extends EncryptResponse, __MetadataBearer
148
148
  * };
149
149
  * const command = new EncryptCommand(input);
150
150
  * const response = await client.send(command);
151
+ * // { // EncryptResponse
152
+ * // CiphertextBlob: "BLOB_VALUE",
153
+ * // KeyId: "STRING_VALUE",
154
+ * // EncryptionAlgorithm: "SYMMETRIC_DEFAULT" || "RSAES_OAEP_SHA_1" || "RSAES_OAEP_SHA_256" || "SM2PKE",
155
+ * // };
156
+ *
151
157
  * ```
152
158
  *
153
159
  * @param EncryptCommandInput - {@link EncryptCommandInput}
@@ -217,10 +223,12 @@ export interface EncryptCommandOutput extends EncryptResponse, __MetadataBearer
217
223
  * <p>The request was rejected because the specified entity or resource could not be
218
224
  * found.</p>
219
225
  *
226
+ * @throws {@link KMSServiceException}
227
+ * <p>Base exception class for all service exceptions from KMS service.</p>
220
228
  *
221
- * @example To encrypt data
229
+ * @example To encrypt data with a symmetric encryption KMS key
222
230
  * ```javascript
223
- * // The following example encrypts data with the specified KMS key.
231
+ * // The following example encrypts data with the specified symmetric encryption KMS key.
224
232
  * const input = {
225
233
  * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
226
234
  * "Plaintext": "<binary data>"
@@ -230,10 +238,51 @@ export interface EncryptCommandOutput extends EncryptResponse, __MetadataBearer
230
238
  * /* response ==
231
239
  * {
232
240
  * "CiphertextBlob": "<binary data>",
241
+ * "EncryptionAlgorithm": "SYMMETRIC_DEFAULT",
233
242
  * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
234
243
  * }
235
244
  * *\/
236
- * // example id: to-encrypt-data-1478906026012
245
+ * // example id: to-encrypt-data-1
246
+ * ```
247
+ *
248
+ * @example To encrypt data with an asymmetric encryption KMS key
249
+ * ```javascript
250
+ * // 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.
251
+ * const input = {
252
+ * "EncryptionAlgorithm": "RSAES_OAEP_SHA_256",
253
+ * "KeyId": "0987dcba-09fe-87dc-65ba-ab0987654321",
254
+ * "Plaintext": "<binary data>"
255
+ * };
256
+ * const command = new EncryptCommand(input);
257
+ * const response = await client.send(command);
258
+ * /* response ==
259
+ * {
260
+ * "CiphertextBlob": "<binary data>",
261
+ * "EncryptionAlgorithm": "RSAES_OAEP_SHA_256",
262
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321"
263
+ * }
264
+ * *\/
265
+ * // example id: to-encrypt-data-2
266
+ * ```
267
+ *
268
+ * @example To encrypt data with an asymmetric encryption KMS key
269
+ * ```javascript
270
+ * // 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.
271
+ * const input = {
272
+ * "EncryptionAlgorithm": "RSAES_OAEP_SHA_256",
273
+ * "KeyId": "0987dcba-09fe-87dc-65ba-ab0987654321",
274
+ * "Plaintext": "<binary data>"
275
+ * };
276
+ * const command = new EncryptCommand(input);
277
+ * const response = await client.send(command);
278
+ * /* response ==
279
+ * {
280
+ * "CiphertextBlob": "<binary data>",
281
+ * "EncryptionAlgorithm": "RSAES_OAEP_SHA_256",
282
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321"
283
+ * }
284
+ * *\/
285
+ * // example id: to-encrypt-data-2
237
286
  * ```
238
287
  *
239
288
  */
@@ -144,6 +144,12 @@ export interface GenerateDataKeyCommandOutput extends GenerateDataKeyResponse, _
144
144
  * };
145
145
  * const command = new GenerateDataKeyCommand(input);
146
146
  * const response = await client.send(command);
147
+ * // { // GenerateDataKeyResponse
148
+ * // CiphertextBlob: "BLOB_VALUE",
149
+ * // Plaintext: "BLOB_VALUE",
150
+ * // KeyId: "STRING_VALUE",
151
+ * // };
152
+ *
147
153
  * ```
148
154
  *
149
155
  * @param GenerateDataKeyCommandInput - {@link GenerateDataKeyCommandInput}
@@ -213,6 +219,8 @@ export interface GenerateDataKeyCommandOutput extends GenerateDataKeyResponse, _
213
219
  * <p>The request was rejected because the specified entity or resource could not be
214
220
  * found.</p>
215
221
  *
222
+ * @throws {@link KMSServiceException}
223
+ * <p>Base exception class for all service exceptions from KMS service.</p>
216
224
  *
217
225
  * @example To generate a data key
218
226
  * ```javascript
@@ -230,7 +238,55 @@ export interface GenerateDataKeyCommandOutput extends GenerateDataKeyResponse, _
230
238
  * "Plaintext": "<binary data>"
231
239
  * }
232
240
  * *\/
233
- * // example id: to-generate-a-data-key-1478912956062
241
+ * // example id: to-generate-a-data-key-1
242
+ * ```
243
+ *
244
+ * @example To generate a data key pair for a Nitro enclave
245
+ * ```javascript
246
+ * // 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.
247
+ * const input = {
248
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
249
+ * "KeySpec": "AES_256",
250
+ * "Recipient": {
251
+ * "AttestationDocument": "<attestation document>",
252
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
253
+ * }
254
+ * };
255
+ * const command = new GenerateDataKeyCommand(input);
256
+ * const response = await client.send(command);
257
+ * /* response ==
258
+ * {
259
+ * "CiphertextBlob": "<binary data>",
260
+ * "CiphertextForRecipient": "<binary data>",
261
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
262
+ * "Plaintext": ""
263
+ * }
264
+ * *\/
265
+ * // example id: to-generate-a-data-key-for-a-nitro-enclave-2
266
+ * ```
267
+ *
268
+ * @example To generate a data key pair for a Nitro enclave
269
+ * ```javascript
270
+ * // 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.
271
+ * const input = {
272
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
273
+ * "KeySpec": "AES_256",
274
+ * "Recipient": {
275
+ * "AttestationDocument": "<attestation document>",
276
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
277
+ * }
278
+ * };
279
+ * const command = new GenerateDataKeyCommand(input);
280
+ * const response = await client.send(command);
281
+ * /* response ==
282
+ * {
283
+ * "CiphertextBlob": "<binary data>",
284
+ * "CiphertextForRecipient": "<binary data>",
285
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
286
+ * "Plaintext": ""
287
+ * }
288
+ * *\/
289
+ * // example id: to-generate-a-data-key-for-a-nitro-enclave-2
234
290
  * ```
235
291
  *
236
292
  */
@@ -121,6 +121,14 @@ export interface GenerateDataKeyPairCommandOutput extends GenerateDataKeyPairRes
121
121
  * };
122
122
  * const command = new GenerateDataKeyPairCommand(input);
123
123
  * const response = await client.send(command);
124
+ * // { // GenerateDataKeyPairResponse
125
+ * // PrivateKeyCiphertextBlob: "BLOB_VALUE",
126
+ * // PrivateKeyPlaintext: "BLOB_VALUE",
127
+ * // PublicKey: "BLOB_VALUE",
128
+ * // KeyId: "STRING_VALUE",
129
+ * // KeyPairSpec: "RSA_2048" || "RSA_3072" || "RSA_4096" || "ECC_NIST_P256" || "ECC_NIST_P384" || "ECC_NIST_P521" || "ECC_SECG_P256K1" || "SM2",
130
+ * // };
131
+ *
124
132
  * ```
125
133
  *
126
134
  * @param GenerateDataKeyPairCommandInput - {@link GenerateDataKeyPairCommandInput}
@@ -194,6 +202,8 @@ export interface GenerateDataKeyPairCommandOutput extends GenerateDataKeyPairRes
194
202
  * <p>The request was rejected because a specified parameter is not supported or a specified
195
203
  * resource is not valid for this operation.</p>
196
204
  *
205
+ * @throws {@link KMSServiceException}
206
+ * <p>Base exception class for all service exceptions from KMS service.</p>
197
207
  *
198
208
  * @example To generate an RSA key pair for encryption and decryption
199
209
  * ```javascript
@@ -213,7 +223,59 @@ export interface GenerateDataKeyPairCommandOutput extends GenerateDataKeyPairRes
213
223
  * "PublicKey": "<binary data>"
214
224
  * }
215
225
  * *\/
216
- * // example id: to-generate-an-rsa-key-pair-for-encryption-and-decryption-1628619376878
226
+ * // example id: to-generate-an-rsa-key-pair-for-encryption-and-decryption-1
227
+ * ```
228
+ *
229
+ * @example To generate a data key pair for a Nitro enclave
230
+ * ```javascript
231
+ * // 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.
232
+ * const input = {
233
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
234
+ * "KeyPairSpec": "RSA_3072",
235
+ * "Recipient": {
236
+ * "AttestationDocument": "<attestation document>",
237
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
238
+ * }
239
+ * };
240
+ * const command = new GenerateDataKeyPairCommand(input);
241
+ * const response = await client.send(command);
242
+ * /* response ==
243
+ * {
244
+ * "CiphertextForRecipient": "<binary data>",
245
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
246
+ * "KeyPairSpec": "RSA_3072",
247
+ * "PrivateKeyCiphertextBlob": "<binary data>",
248
+ * "PrivateKeyPlaintext": "",
249
+ * "PublicKey": "<binary data>"
250
+ * }
251
+ * *\/
252
+ * // example id: to-generate-a-data-key-pair-for-a-nitro-enclave-2
253
+ * ```
254
+ *
255
+ * @example To generate a data key pair for a Nitro enclave
256
+ * ```javascript
257
+ * // 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.
258
+ * const input = {
259
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
260
+ * "KeyPairSpec": "RSA_3072",
261
+ * "Recipient": {
262
+ * "AttestationDocument": "<attestation document>",
263
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
264
+ * }
265
+ * };
266
+ * const command = new GenerateDataKeyPairCommand(input);
267
+ * const response = await client.send(command);
268
+ * /* response ==
269
+ * {
270
+ * "CiphertextForRecipient": "<binary data>",
271
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
272
+ * "KeyPairSpec": "RSA_3072",
273
+ * "PrivateKeyCiphertextBlob": "<binary data>",
274
+ * "PrivateKeyPlaintext": "",
275
+ * "PublicKey": "<binary data>"
276
+ * }
277
+ * *\/
278
+ * // example id: to-generate-a-data-key-pair-for-a-nitro-enclave-2
217
279
  * ```
218
280
  *
219
281
  */
@@ -100,6 +100,13 @@ export interface GenerateDataKeyPairWithoutPlaintextCommandOutput extends Genera
100
100
  * };
101
101
  * const command = new GenerateDataKeyPairWithoutPlaintextCommand(input);
102
102
  * const response = await client.send(command);
103
+ * // { // GenerateDataKeyPairWithoutPlaintextResponse
104
+ * // PrivateKeyCiphertextBlob: "BLOB_VALUE",
105
+ * // PublicKey: "BLOB_VALUE",
106
+ * // KeyId: "STRING_VALUE",
107
+ * // KeyPairSpec: "RSA_2048" || "RSA_3072" || "RSA_4096" || "ECC_NIST_P256" || "ECC_NIST_P384" || "ECC_NIST_P521" || "ECC_SECG_P256K1" || "SM2",
108
+ * // };
109
+ *
103
110
  * ```
104
111
  *
105
112
  * @param GenerateDataKeyPairWithoutPlaintextCommandInput - {@link GenerateDataKeyPairWithoutPlaintextCommandInput}
@@ -173,6 +180,8 @@ export interface GenerateDataKeyPairWithoutPlaintextCommandOutput extends Genera
173
180
  * <p>The request was rejected because a specified parameter is not supported or a specified
174
181
  * resource is not valid for this operation.</p>
175
182
  *
183
+ * @throws {@link KMSServiceException}
184
+ * <p>Base exception class for all service exceptions from KMS service.</p>
176
185
  *
177
186
  * @example To generate an asymmetric data key pair without a plaintext key
178
187
  * ```javascript
@@ -110,6 +110,11 @@ export interface GenerateDataKeyWithoutPlaintextCommandOutput extends GenerateDa
110
110
  * };
111
111
  * const command = new GenerateDataKeyWithoutPlaintextCommand(input);
112
112
  * const response = await client.send(command);
113
+ * // { // GenerateDataKeyWithoutPlaintextResponse
114
+ * // CiphertextBlob: "BLOB_VALUE",
115
+ * // KeyId: "STRING_VALUE",
116
+ * // };
117
+ *
113
118
  * ```
114
119
  *
115
120
  * @param GenerateDataKeyWithoutPlaintextCommandInput - {@link GenerateDataKeyWithoutPlaintextCommandInput}
@@ -179,6 +184,8 @@ export interface GenerateDataKeyWithoutPlaintextCommandOutput extends GenerateDa
179
184
  * <p>The request was rejected because the specified entity or resource could not be
180
185
  * found.</p>
181
186
  *
187
+ * @throws {@link KMSServiceException}
188
+ * <p>Base exception class for all service exceptions from KMS service.</p>
182
189
  *
183
190
  * @example To generate an encrypted data key
184
191
  * ```javascript
@@ -63,6 +63,12 @@ export interface GenerateMacCommandOutput extends GenerateMacResponse, __Metadat
63
63
  * };
64
64
  * const command = new GenerateMacCommand(input);
65
65
  * const response = await client.send(command);
66
+ * // { // GenerateMacResponse
67
+ * // Mac: "BLOB_VALUE",
68
+ * // MacAlgorithm: "HMAC_SHA_224" || "HMAC_SHA_256" || "HMAC_SHA_384" || "HMAC_SHA_512",
69
+ * // KeyId: "STRING_VALUE",
70
+ * // };
71
+ *
66
72
  * ```
67
73
  *
68
74
  * @param GenerateMacCommandInput - {@link GenerateMacCommandInput}
@@ -128,6 +134,8 @@ export interface GenerateMacCommandOutput extends GenerateMacResponse, __Metadat
128
134
  * <p>The request was rejected because the specified entity or resource could not be
129
135
  * found.</p>
130
136
  *
137
+ * @throws {@link KMSServiceException}
138
+ * <p>Base exception class for all service exceptions from KMS service.</p>
131
139
  *
132
140
  * @example To generate an HMAC for a message
133
141
  * ```javascript
@@ -56,6 +56,10 @@ export interface GenerateRandomCommandOutput extends GenerateRandomResponse, __M
56
56
  * };
57
57
  * const command = new GenerateRandomCommand(input);
58
58
  * const response = await client.send(command);
59
+ * // { // GenerateRandomResponse
60
+ * // Plaintext: "BLOB_VALUE",
61
+ * // };
62
+ *
59
63
  * ```
60
64
  *
61
65
  * @param GenerateRandomCommandInput - {@link GenerateRandomCommandInput}
@@ -116,6 +120,8 @@ export interface GenerateRandomCommandOutput extends GenerateRandomResponse, __M
116
120
  * <p>The request was rejected because a specified parameter is not supported or a specified
117
121
  * resource is not valid for this operation.</p>
118
122
  *
123
+ * @throws {@link KMSServiceException}
124
+ * <p>Base exception class for all service exceptions from KMS service.</p>
119
125
  *
120
126
  * @example To generate random data
121
127
  * ```javascript
@@ -130,7 +136,49 @@ export interface GenerateRandomCommandOutput extends GenerateRandomResponse, __M
130
136
  * "Plaintext": "<binary data>"
131
137
  * }
132
138
  * *\/
133
- * // example id: to-generate-random-data-1479163645600
139
+ * // example id: to-generate-random-data-1
140
+ * ```
141
+ *
142
+ * @example To generate random data
143
+ * ```javascript
144
+ * // 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.
145
+ * const input = {
146
+ * "NumberOfBytes": 1024,
147
+ * "Recipient": {
148
+ * "AttestationDocument": "<attestation document>",
149
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
150
+ * }
151
+ * };
152
+ * const command = new GenerateRandomCommand(input);
153
+ * const response = await client.send(command);
154
+ * /* response ==
155
+ * {
156
+ * "CiphertextForRecipient": "<binary data>",
157
+ * "Plaintext": ""
158
+ * }
159
+ * *\/
160
+ * // example id: to-generate-random-data-2
161
+ * ```
162
+ *
163
+ * @example To generate random data
164
+ * ```javascript
165
+ * // 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.
166
+ * const input = {
167
+ * "NumberOfBytes": 1024,
168
+ * "Recipient": {
169
+ * "AttestationDocument": "<attestation document>",
170
+ * "KeyEncryptionAlgorithm": "RSAES_OAEP_SHA_256"
171
+ * }
172
+ * };
173
+ * const command = new GenerateRandomCommand(input);
174
+ * const response = await client.send(command);
175
+ * /* response ==
176
+ * {
177
+ * "CiphertextForRecipient": "<binary data>",
178
+ * "Plaintext": ""
179
+ * }
180
+ * *\/
181
+ * // example id: to-generate-random-data-2
134
182
  * ```
135
183
  *
136
184
  */
@@ -39,6 +39,10 @@ export interface GetKeyPolicyCommandOutput extends GetKeyPolicyResponse, __Metad
39
39
  * };
40
40
  * const command = new GetKeyPolicyCommand(input);
41
41
  * const response = await client.send(command);
42
+ * // { // GetKeyPolicyResponse
43
+ * // Policy: "STRING_VALUE",
44
+ * // };
45
+ *
42
46
  * ```
43
47
  *
44
48
  * @param GetKeyPolicyCommandInput - {@link GetKeyPolicyCommandInput}
@@ -81,6 +85,8 @@ export interface GetKeyPolicyCommandOutput extends GetKeyPolicyResponse, __Metad
81
85
  * <p>The request was rejected because the specified entity or resource could not be
82
86
  * found.</p>
83
87
  *
88
+ * @throws {@link KMSServiceException}
89
+ * <p>Base exception class for all service exceptions from KMS service.</p>
84
90
  *
85
91
  * @example To retrieve a key policy
86
92
  * ```javascript
@@ -83,6 +83,10 @@ export interface GetKeyRotationStatusCommandOutput extends GetKeyRotationStatusR
83
83
  * };
84
84
  * const command = new GetKeyRotationStatusCommand(input);
85
85
  * const response = await client.send(command);
86
+ * // { // GetKeyRotationStatusResponse
87
+ * // KeyRotationEnabled: true || false,
88
+ * // };
89
+ *
86
90
  * ```
87
91
  *
88
92
  * @param GetKeyRotationStatusCommandInput - {@link GetKeyRotationStatusCommandInput}
@@ -129,6 +133,8 @@ export interface GetKeyRotationStatusCommandOutput extends GetKeyRotationStatusR
129
133
  * <p>The request was rejected because a specified parameter is not supported or a specified
130
134
  * resource is not valid for this operation.</p>
131
135
  *
136
+ * @throws {@link KMSServiceException}
137
+ * <p>Base exception class for all service exceptions from KMS service.</p>
132
138
  *
133
139
  * @example To retrieve the rotation status for a KMS key
134
140
  * ```javascript
@@ -66,6 +66,13 @@ export interface GetParametersForImportCommandOutput extends GetParametersForImp
66
66
  * };
67
67
  * const command = new GetParametersForImportCommand(input);
68
68
  * const response = await client.send(command);
69
+ * // { // GetParametersForImportResponse
70
+ * // KeyId: "STRING_VALUE",
71
+ * // ImportToken: "BLOB_VALUE",
72
+ * // PublicKey: "BLOB_VALUE",
73
+ * // ParametersValidTo: new Date("TIMESTAMP"),
74
+ * // };
75
+ *
69
76
  * ```
70
77
  *
71
78
  * @param GetParametersForImportCommandInput - {@link GetParametersForImportCommandInput}
@@ -112,6 +119,8 @@ export interface GetParametersForImportCommandOutput extends GetParametersForImp
112
119
  * <p>The request was rejected because a specified parameter is not supported or a specified
113
120
  * resource is not valid for this operation.</p>
114
121
  *
122
+ * @throws {@link KMSServiceException}
123
+ * <p>Base exception class for all service exceptions from KMS service.</p>
115
124
  *
116
125
  * @example To retrieve the public key and import token for a KMS key
117
126
  * ```javascript
@@ -82,6 +82,20 @@ export interface GetPublicKeyCommandOutput extends GetPublicKeyResponse, __Metad
82
82
  * };
83
83
  * const command = new GetPublicKeyCommand(input);
84
84
  * const response = await client.send(command);
85
+ * // { // GetPublicKeyResponse
86
+ * // KeyId: "STRING_VALUE",
87
+ * // PublicKey: "BLOB_VALUE",
88
+ * // CustomerMasterKeySpec: "RSA_2048" || "RSA_3072" || "RSA_4096" || "ECC_NIST_P256" || "ECC_NIST_P384" || "ECC_NIST_P521" || "ECC_SECG_P256K1" || "SYMMETRIC_DEFAULT" || "HMAC_224" || "HMAC_256" || "HMAC_384" || "HMAC_512" || "SM2",
89
+ * // KeySpec: "RSA_2048" || "RSA_3072" || "RSA_4096" || "ECC_NIST_P256" || "ECC_NIST_P384" || "ECC_NIST_P521" || "ECC_SECG_P256K1" || "SYMMETRIC_DEFAULT" || "HMAC_224" || "HMAC_256" || "HMAC_384" || "HMAC_512" || "SM2",
90
+ * // KeyUsage: "SIGN_VERIFY" || "ENCRYPT_DECRYPT" || "GENERATE_VERIFY_MAC",
91
+ * // EncryptionAlgorithms: [ // EncryptionAlgorithmSpecList
92
+ * // "SYMMETRIC_DEFAULT" || "RSAES_OAEP_SHA_1" || "RSAES_OAEP_SHA_256" || "SM2PKE",
93
+ * // ],
94
+ * // SigningAlgorithms: [ // SigningAlgorithmSpecList
95
+ * // "RSASSA_PSS_SHA_256" || "RSASSA_PSS_SHA_384" || "RSASSA_PSS_SHA_512" || "RSASSA_PKCS1_V1_5_SHA_256" || "RSASSA_PKCS1_V1_5_SHA_384" || "RSASSA_PKCS1_V1_5_SHA_512" || "ECDSA_SHA_256" || "ECDSA_SHA_384" || "ECDSA_SHA_512" || "SM2DSA",
96
+ * // ],
97
+ * // };
98
+ *
85
99
  * ```
86
100
  *
87
101
  * @param GetPublicKeyCommandInput - {@link GetPublicKeyCommandInput}
@@ -159,6 +173,8 @@ export interface GetPublicKeyCommandOutput extends GetPublicKeyResponse, __Metad
159
173
  * <p>The request was rejected because a specified parameter is not supported or a specified
160
174
  * resource is not valid for this operation.</p>
161
175
  *
176
+ * @throws {@link KMSServiceException}
177
+ * <p>Base exception class for all service exceptions from KMS service.</p>
162
178
  *
163
179
  * @example To download the public key of an asymmetric KMS key
164
180
  * ```javascript
@@ -98,6 +98,8 @@ export interface ImportKeyMaterialCommandOutput extends ImportKeyMaterialRespons
98
98
  * };
99
99
  * const command = new ImportKeyMaterialCommand(input);
100
100
  * const response = await client.send(command);
101
+ * // {};
102
+ *
101
103
  * ```
102
104
  *
103
105
  * @param ImportKeyMaterialCommandInput - {@link ImportKeyMaterialCommandInput}
@@ -164,6 +166,8 @@ export interface ImportKeyMaterialCommandOutput extends ImportKeyMaterialRespons
164
166
  * <p>The request was rejected because a specified parameter is not supported or a specified
165
167
  * resource is not valid for this operation.</p>
166
168
  *
169
+ * @throws {@link KMSServiceException}
170
+ * <p>Base exception class for all service exceptions from KMS service.</p>
167
171
  *
168
172
  * @example To import key material into a KMS key
169
173
  * ```javascript
@@ -73,6 +73,20 @@ export interface ListAliasesCommandOutput extends ListAliasesResponse, __Metadat
73
73
  * };
74
74
  * const command = new ListAliasesCommand(input);
75
75
  * const response = await client.send(command);
76
+ * // { // ListAliasesResponse
77
+ * // Aliases: [ // AliasList
78
+ * // { // AliasListEntry
79
+ * // AliasName: "STRING_VALUE",
80
+ * // AliasArn: "STRING_VALUE",
81
+ * // TargetKeyId: "STRING_VALUE",
82
+ * // CreationDate: new Date("TIMESTAMP"),
83
+ * // LastUpdatedDate: new Date("TIMESTAMP"),
84
+ * // },
85
+ * // ],
86
+ * // NextMarker: "STRING_VALUE",
87
+ * // Truncated: true || false,
88
+ * // };
89
+ *
76
90
  * ```
77
91
  *
78
92
  * @param ListAliasesCommandInput - {@link ListAliasesCommandInput}
@@ -101,6 +115,8 @@ export interface ListAliasesCommandOutput extends ListAliasesResponse, __Metadat
101
115
  * <p>The request was rejected because the specified entity or resource could not be
102
116
  * found.</p>
103
117
  *
118
+ * @throws {@link KMSServiceException}
119
+ * <p>Base exception class for all service exceptions from KMS service.</p>
104
120
  *
105
121
  * @example To list aliases
106
122
  * ```javascript
@@ -79,6 +79,33 @@ export interface ListGrantsCommandOutput extends ListGrantsResponse, __MetadataB
79
79
  * };
80
80
  * const command = new ListGrantsCommand(input);
81
81
  * const response = await client.send(command);
82
+ * // { // ListGrantsResponse
83
+ * // Grants: [ // GrantList
84
+ * // { // GrantListEntry
85
+ * // KeyId: "STRING_VALUE",
86
+ * // GrantId: "STRING_VALUE",
87
+ * // Name: "STRING_VALUE",
88
+ * // CreationDate: new Date("TIMESTAMP"),
89
+ * // GranteePrincipal: "STRING_VALUE",
90
+ * // RetiringPrincipal: "STRING_VALUE",
91
+ * // IssuingAccount: "STRING_VALUE",
92
+ * // Operations: [ // GrantOperationList
93
+ * // "Decrypt" || "Encrypt" || "GenerateDataKey" || "GenerateDataKeyWithoutPlaintext" || "ReEncryptFrom" || "ReEncryptTo" || "Sign" || "Verify" || "GetPublicKey" || "CreateGrant" || "RetireGrant" || "DescribeKey" || "GenerateDataKeyPair" || "GenerateDataKeyPairWithoutPlaintext" || "GenerateMac" || "VerifyMac",
94
+ * // ],
95
+ * // Constraints: { // GrantConstraints
96
+ * // EncryptionContextSubset: { // EncryptionContextType
97
+ * // "<keys>": "STRING_VALUE",
98
+ * // },
99
+ * // EncryptionContextEquals: {
100
+ * // "<keys>": "STRING_VALUE",
101
+ * // },
102
+ * // },
103
+ * // },
104
+ * // ],
105
+ * // NextMarker: "STRING_VALUE",
106
+ * // Truncated: true || false,
107
+ * // };
108
+ *
82
109
  * ```
83
110
  *
84
111
  * @param ListGrantsCommandInput - {@link ListGrantsCommandInput}
@@ -128,6 +155,8 @@ export interface ListGrantsCommandOutput extends ListGrantsResponse, __MetadataB
128
155
  * <p>The request was rejected because the specified entity or resource could not be
129
156
  * found.</p>
130
157
  *
158
+ * @throws {@link KMSServiceException}
159
+ * <p>Base exception class for all service exceptions from KMS service.</p>
131
160
  *
132
161
  * @example To list grants for a KMS key
133
162
  * ```javascript
@@ -54,6 +54,14 @@ export interface ListKeyPoliciesCommandOutput extends ListKeyPoliciesResponse, _
54
54
  * };
55
55
  * const command = new ListKeyPoliciesCommand(input);
56
56
  * const response = await client.send(command);
57
+ * // { // ListKeyPoliciesResponse
58
+ * // PolicyNames: [ // PolicyNameList
59
+ * // "STRING_VALUE",
60
+ * // ],
61
+ * // NextMarker: "STRING_VALUE",
62
+ * // Truncated: true || false,
63
+ * // };
64
+ *
57
65
  * ```
58
66
  *
59
67
  * @param ListKeyPoliciesCommandInput - {@link ListKeyPoliciesCommandInput}
@@ -96,6 +104,8 @@ export interface ListKeyPoliciesCommandOutput extends ListKeyPoliciesResponse, _
96
104
  * <p>The request was rejected because the specified entity or resource could not be
97
105
  * found.</p>
98
106
  *
107
+ * @throws {@link KMSServiceException}
108
+ * <p>Base exception class for all service exceptions from KMS service.</p>
99
109
  *
100
110
  * @example To list key policies for a KMS key
101
111
  * ```javascript
@@ -61,6 +61,17 @@ export interface ListKeysCommandOutput extends ListKeysResponse, __MetadataBeare
61
61
  * };
62
62
  * const command = new ListKeysCommand(input);
63
63
  * const response = await client.send(command);
64
+ * // { // ListKeysResponse
65
+ * // Keys: [ // KeyList
66
+ * // { // KeyListEntry
67
+ * // KeyId: "STRING_VALUE",
68
+ * // KeyArn: "STRING_VALUE",
69
+ * // },
70
+ * // ],
71
+ * // NextMarker: "STRING_VALUE",
72
+ * // Truncated: true || false,
73
+ * // };
74
+ *
64
75
  * ```
65
76
  *
66
77
  * @param ListKeysCommandInput - {@link ListKeysCommandInput}
@@ -81,6 +92,8 @@ export interface ListKeysCommandOutput extends ListKeysResponse, __MetadataBeare
81
92
  * <p>The request was rejected because an internal exception occurred. The request can be
82
93
  * retried.</p>
83
94
  *
95
+ * @throws {@link KMSServiceException}
96
+ * <p>Base exception class for all service exceptions from KMS service.</p>
84
97
  *
85
98
  * @example To list KMS keys
86
99
  * ```javascript
@@ -66,6 +66,17 @@ export interface ListResourceTagsCommandOutput extends ListResourceTagsResponse,
66
66
  * };
67
67
  * const command = new ListResourceTagsCommand(input);
68
68
  * const response = await client.send(command);
69
+ * // { // ListResourceTagsResponse
70
+ * // Tags: [ // TagList
71
+ * // { // Tag
72
+ * // TagKey: "STRING_VALUE", // required
73
+ * // TagValue: "STRING_VALUE", // required
74
+ * // },
75
+ * // ],
76
+ * // NextMarker: "STRING_VALUE",
77
+ * // Truncated: true || false,
78
+ * // };
79
+ *
69
80
  * ```
70
81
  *
71
82
  * @param ListResourceTagsCommandInput - {@link ListResourceTagsCommandInput}
@@ -90,6 +101,8 @@ export interface ListResourceTagsCommandOutput extends ListResourceTagsResponse,
90
101
  * <p>The request was rejected because the specified entity or resource could not be
91
102
  * found.</p>
92
103
  *
104
+ * @throws {@link KMSServiceException}
105
+ * <p>Base exception class for all service exceptions from KMS service.</p>
93
106
  *
94
107
  * @example To list tags for a KMS key
95
108
  * ```javascript