@aws-sdk/client-kms 3.288.0 → 3.289.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 +16 -0
  2. package/dist-types/commands/ConnectCustomKeyStoreCommand.d.ts +11 -0
  3. package/dist-types/commands/CreateAliasCommand.d.ts +12 -0
  4. package/dist-types/commands/CreateCustomKeyStoreCommand.d.ts +68 -0
  5. package/dist-types/commands/CreateGrantCommand.d.ts +22 -0
  6. package/dist-types/commands/CreateKeyCommand.d.ts +283 -0
  7. package/dist-types/commands/DecryptCommand.d.ts +18 -0
  8. package/dist-types/commands/DeleteAliasCommand.d.ts +11 -0
  9. package/dist-types/commands/DeleteCustomKeyStoreCommand.d.ts +11 -0
  10. package/dist-types/commands/DeleteImportedKeyMaterialCommand.d.ts +11 -0
  11. package/dist-types/commands/DescribeCustomKeyStoresCommand.d.ts +101 -0
  12. package/dist-types/commands/DescribeKeyCommand.d.ts +228 -0
  13. package/dist-types/commands/DisableKeyCommand.d.ts +11 -0
  14. package/dist-types/commands/DisableKeyRotationCommand.d.ts +11 -0
  15. package/dist-types/commands/DisconnectCustomKeyStoreCommand.d.ts +11 -0
  16. package/dist-types/commands/EnableKeyCommand.d.ts +11 -0
  17. package/dist-types/commands/EnableKeyRotationCommand.d.ts +11 -0
  18. package/dist-types/commands/EncryptCommand.d.ts +18 -0
  19. package/dist-types/commands/GenerateDataKeyCommand.d.ts +19 -0
  20. package/dist-types/commands/GenerateDataKeyPairCommand.d.ts +21 -0
  21. package/dist-types/commands/GenerateDataKeyPairWithoutPlaintextCommand.d.ts +20 -0
  22. package/dist-types/commands/GenerateDataKeyWithoutPlaintextCommand.d.ts +18 -0
  23. package/dist-types/commands/GenerateMacCommand.d.ts +20 -0
  24. package/dist-types/commands/GenerateRandomCommand.d.ts +16 -0
  25. package/dist-types/commands/GetKeyPolicyCommand.d.ts +17 -0
  26. package/dist-types/commands/GetKeyRotationStatusCommand.d.ts +16 -0
  27. package/dist-types/commands/GetParametersForImportCommand.d.ts +21 -0
  28. package/dist-types/commands/GetPublicKeyCommand.d.ts +23 -0
  29. package/dist-types/commands/ImportKeyMaterialCommand.d.ts +14 -0
  30. package/dist-types/commands/ListAliasesCommand.d.ts +56 -0
  31. package/dist-types/commands/ListGrantsCommand.d.ts +69 -0
  32. package/dist-types/commands/ListKeyPoliciesCommand.d.ts +19 -0
  33. package/dist-types/commands/ListKeysCommand.d.ts +44 -0
  34. package/dist-types/commands/ListResourceTagsCommand.d.ts +30 -0
  35. package/dist-types/commands/ListRetirableGrantsCommand.d.ts +30 -0
  36. package/dist-types/commands/PutKeyPolicyCommand.d.ts +13 -0
  37. package/dist-types/commands/ReEncryptCommand.d.ts +19 -0
  38. package/dist-types/commands/ReplicateKeyCommand.d.ts +48 -0
  39. package/dist-types/commands/RetireGrantCommand.d.ts +12 -0
  40. package/dist-types/commands/RevokeGrantCommand.d.ts +12 -0
  41. package/dist-types/commands/ScheduleKeyDeletionCommand.d.ts +18 -0
  42. package/dist-types/commands/SignCommand.d.ts +42 -0
  43. package/dist-types/commands/TagResourceCommand.d.ts +17 -0
  44. package/dist-types/commands/UntagResourceCommand.d.ts +15 -0
  45. package/dist-types/commands/UpdateAliasCommand.d.ts +12 -0
  46. package/dist-types/commands/UpdateCustomKeyStoreCommand.d.ts +77 -0
  47. package/dist-types/commands/UpdateKeyDescriptionCommand.d.ts +12 -0
  48. package/dist-types/commands/UpdatePrimaryRegionCommand.d.ts +16 -0
  49. package/dist-types/commands/VerifyCommand.d.ts +44 -0
  50. package/dist-types/commands/VerifyMacCommand.d.ts +21 -0
  51. package/package.json +29 -29
@@ -111,6 +111,234 @@ export interface DescribeKeyCommandOutput extends DescribeKeyResponse, __Metadat
111
111
  * @see {@link DescribeKeyCommandOutput} for command's `response` shape.
112
112
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
113
113
  *
114
+ * @example To get details about a KMS key
115
+ * ```javascript
116
+ * // The following example gets metadata for a symmetric encryption KMS key.
117
+ * const input = {
118
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
119
+ * };
120
+ * const command = new DescribeKeyCommand(input);
121
+ * const response = await client.send(command);
122
+ * /* response ==
123
+ * {
124
+ * "KeyMetadata": {
125
+ * "AWSAccountId": "111122223333",
126
+ * "Arn": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
127
+ * "CreationDate": "2017-07-05T14:04:55-07:00",
128
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
129
+ * "Description": "",
130
+ * "Enabled": true,
131
+ * "EncryptionAlgorithms": [
132
+ * "SYMMETRIC_DEFAULT"
133
+ * ],
134
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
135
+ * "KeyManager": "CUSTOMER",
136
+ * "KeySpec": "SYMMETRIC_DEFAULT",
137
+ * "KeyState": "Enabled",
138
+ * "KeyUsage": "ENCRYPT_DECRYPT",
139
+ * "MultiRegion": false,
140
+ * "Origin": "AWS_KMS"
141
+ * }
142
+ * }
143
+ * *\/
144
+ * // example id: get-key-details-1
145
+ * ```
146
+ *
147
+ * @example To get details about an RSA asymmetric KMS key
148
+ * ```javascript
149
+ * // The following example gets metadata for an asymmetric RSA KMS key used for signing and verification.
150
+ * const input = {
151
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
152
+ * };
153
+ * const command = new DescribeKeyCommand(input);
154
+ * const response = await client.send(command);
155
+ * /* response ==
156
+ * {
157
+ * "KeyMetadata": {
158
+ * "AWSAccountId": "111122223333",
159
+ * "Arn": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
160
+ * "CreationDate": 1571767572.317,
161
+ * "CustomerMasterKeySpec": "RSA_2048",
162
+ * "Description": "",
163
+ * "Enabled": false,
164
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
165
+ * "KeyManager": "CUSTOMER",
166
+ * "KeySpec": "RSA_2048",
167
+ * "KeyState": "Disabled",
168
+ * "KeyUsage": "SIGN_VERIFY",
169
+ * "MultiRegion": false,
170
+ * "Origin": "AWS_KMS",
171
+ * "SigningAlgorithms": [
172
+ * "RSASSA_PKCS1_V1_5_SHA_256",
173
+ * "RSASSA_PKCS1_V1_5_SHA_384",
174
+ * "RSASSA_PKCS1_V1_5_SHA_512",
175
+ * "RSASSA_PSS_SHA_256",
176
+ * "RSASSA_PSS_SHA_384",
177
+ * "RSASSA_PSS_SHA_512"
178
+ * ]
179
+ * }
180
+ * }
181
+ * *\/
182
+ * // example id: to-get-details-about-an-rsa-asymmetric-kms-key-2
183
+ * ```
184
+ *
185
+ * @example To get details about a multi-Region key
186
+ * ```javascript
187
+ * // The following example gets metadata for a multi-Region replica key. This multi-Region key is a symmetric encryption key. DescribeKey returns information about the primary key and all of its replicas.
188
+ * const input = {
189
+ * "KeyId": "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab"
190
+ * };
191
+ * const command = new DescribeKeyCommand(input);
192
+ * const response = await client.send(command);
193
+ * /* response ==
194
+ * {
195
+ * "KeyMetadata": {
196
+ * "AWSAccountId": "111122223333",
197
+ * "Arn": "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
198
+ * "CreationDate": 1586329200.918,
199
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
200
+ * "Description": "",
201
+ * "Enabled": true,
202
+ * "EncryptionAlgorithms": [
203
+ * "SYMMETRIC_DEFAULT"
204
+ * ],
205
+ * "KeyId": "mrk-1234abcd12ab34cd56ef1234567890ab",
206
+ * "KeyManager": "CUSTOMER",
207
+ * "KeyState": "Enabled",
208
+ * "KeyUsage": "ENCRYPT_DECRYPT",
209
+ * "MultiRegion": true,
210
+ * "MultiRegionConfiguration": {
211
+ * "MultiRegionKeyType": "PRIMARY",
212
+ * "PrimaryKey": {
213
+ * "Arn": "arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
214
+ * "Region": "us-west-2"
215
+ * },
216
+ * "ReplicaKeys": [
217
+ * {
218
+ * "Arn": "arn:aws:kms:eu-west-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
219
+ * "Region": "eu-west-1"
220
+ * },
221
+ * {
222
+ * "Arn": "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
223
+ * "Region": "ap-northeast-1"
224
+ * },
225
+ * {
226
+ * "Arn": "arn:aws:kms:sa-east-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
227
+ * "Region": "sa-east-1"
228
+ * }
229
+ * ]
230
+ * },
231
+ * "Origin": "AWS_KMS"
232
+ * }
233
+ * }
234
+ * *\/
235
+ * // example id: to-get-details-about-a-multi-region-key-3
236
+ * ```
237
+ *
238
+ * @example To get details about an HMAC KMS key
239
+ * ```javascript
240
+ * // The following example gets the metadata of an HMAC KMS key.
241
+ * const input = {
242
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
243
+ * };
244
+ * const command = new DescribeKeyCommand(input);
245
+ * const response = await client.send(command);
246
+ * /* response ==
247
+ * {
248
+ * "KeyMetadata": {
249
+ * "AWSAccountId": "123456789012",
250
+ * "Arn": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
251
+ * "CreationDate": 1566160362.664,
252
+ * "CustomerMasterKeySpec": "HMAC_256",
253
+ * "Description": "Development test key",
254
+ * "Enabled": true,
255
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
256
+ * "KeyManager": "CUSTOMER",
257
+ * "KeyState": "Enabled",
258
+ * "KeyUsage": "GENERATE_VERIFY_MAC",
259
+ * "MacAlgorithms": [
260
+ * "HMAC_SHA_256"
261
+ * ],
262
+ * "MultiRegion": false,
263
+ * "Origin": "AWS_KMS"
264
+ * }
265
+ * }
266
+ * *\/
267
+ * // example id: to-get-details-about-an-hmac-kms-key-4
268
+ * ```
269
+ *
270
+ * @example To get details about a KMS key in an AWS CloudHSM key store
271
+ * ```javascript
272
+ * // The following example gets the metadata of a KMS key in an AWS CloudHSM key store.
273
+ * const input = {
274
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
275
+ * };
276
+ * const command = new DescribeKeyCommand(input);
277
+ * const response = await client.send(command);
278
+ * /* response ==
279
+ * {
280
+ * "KeyMetadata": {
281
+ * "AWSAccountId": "123456789012",
282
+ * "Arn": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
283
+ * "CloudHsmClusterId": "cluster-1a23b4cdefg",
284
+ * "CreationDate": 1646160362.664,
285
+ * "CustomKeyStoreId": "cks-1234567890abcdef0",
286
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
287
+ * "Description": "CloudHSM key store test key",
288
+ * "Enabled": true,
289
+ * "EncryptionAlgorithms": [
290
+ * "SYMMETRIC_DEFAULT"
291
+ * ],
292
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
293
+ * "KeyManager": "CUSTOMER",
294
+ * "KeySpec": "SYMMETRIC_DEFAULT",
295
+ * "KeyState": "Enabled",
296
+ * "KeyUsage": "ENCRYPT_DECRYPT",
297
+ * "MultiRegion": false,
298
+ * "Origin": "AWS_CLOUDHSM"
299
+ * }
300
+ * }
301
+ * *\/
302
+ * // example id: to-get-details-about-a-kms-key-in-an-AWS-CloudHSM-key-store-5
303
+ * ```
304
+ *
305
+ * @example To get details about a KMS key in an external key store
306
+ * ```javascript
307
+ * // The following example gets the metadata of a KMS key in an external key store.
308
+ * const input = {
309
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
310
+ * };
311
+ * const command = new DescribeKeyCommand(input);
312
+ * const response = await client.send(command);
313
+ * /* response ==
314
+ * {
315
+ * "KeyMetadata": {
316
+ * "AWSAccountId": "123456789012",
317
+ * "Arn": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
318
+ * "CreationDate": 1646160362.664,
319
+ * "CustomKeyStoreId": "cks-1234567890abcdef0",
320
+ * "CustomerMasterKeySpec": "SYMMETRIC_DEFAULT",
321
+ * "Description": "External key store test key",
322
+ * "Enabled": true,
323
+ * "EncryptionAlgorithms": [
324
+ * "SYMMETRIC_DEFAULT"
325
+ * ],
326
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
327
+ * "KeyManager": "CUSTOMER",
328
+ * "KeySpec": "SYMMETRIC_DEFAULT",
329
+ * "KeyState": "Enabled",
330
+ * "KeyUsage": "ENCRYPT_DECRYPT",
331
+ * "MultiRegion": false,
332
+ * "Origin": "EXTERNAL_KEY_STORE",
333
+ * "XksKeyConfiguration": {
334
+ * "Id": "bb8562717f809024"
335
+ * }
336
+ * }
337
+ * }
338
+ * *\/
339
+ * // example id: to-get-details-about-a-kms-key-in-an-external-key-store-6
340
+ * ```
341
+ *
114
342
  */
115
343
  export declare class DescribeKeyCommand extends $Command<DescribeKeyCommandInput, DescribeKeyCommandOutput, KMSClientResolvedConfig> {
116
344
  readonly input: DescribeKeyCommandInput;
@@ -43,6 +43,17 @@ export interface DisableKeyCommandOutput extends __MetadataBearer {
43
43
  * @see {@link DisableKeyCommandOutput} for command's `response` shape.
44
44
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
45
45
  *
46
+ * @example To disable a KMS key
47
+ * ```javascript
48
+ * // The following example disables the specified KMS key.
49
+ * const input = {
50
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
51
+ * };
52
+ * const command = new DisableKeyCommand(input);
53
+ * await client.send(command);
54
+ * // example id: to-disable-a-cmk-1478566583659
55
+ * ```
56
+ *
46
57
  */
47
58
  export declare class DisableKeyCommand extends $Command<DisableKeyCommandInput, DisableKeyCommandOutput, KMSClientResolvedConfig> {
48
59
  readonly input: DisableKeyCommandInput;
@@ -61,6 +61,17 @@ export interface DisableKeyRotationCommandOutput extends __MetadataBearer {
61
61
  * @see {@link DisableKeyRotationCommandOutput} for command's `response` shape.
62
62
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
63
63
  *
64
+ * @example To disable automatic rotation of key material
65
+ * ```javascript
66
+ * // The following example disables automatic annual rotation of the key material for the specified KMS key.
67
+ * const input = {
68
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
69
+ * };
70
+ * const command = new DisableKeyRotationCommand(input);
71
+ * await client.send(command);
72
+ * // example id: to-disable-automatic-rotation-of-key-material-1478624396092
73
+ * ```
74
+ *
64
75
  */
65
76
  export declare class DisableKeyRotationCommand extends $Command<DisableKeyRotationCommandInput, DisableKeyRotationCommandOutput, KMSClientResolvedConfig> {
66
77
  readonly input: DisableKeyRotationCommandInput;
@@ -80,6 +80,17 @@ export interface DisconnectCustomKeyStoreCommandOutput extends DisconnectCustomK
80
80
  * @see {@link DisconnectCustomKeyStoreCommandOutput} for command's `response` shape.
81
81
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
82
82
  *
83
+ * @example To disconnect a custom key store from its CloudHSM cluster
84
+ * ```javascript
85
+ * // 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.
86
+ * const input = {
87
+ * "CustomKeyStoreId": "cks-1234567890abcdef0"
88
+ * };
89
+ * const command = new DisconnectCustomKeyStoreCommand(input);
90
+ * await client.send(command);
91
+ * // example id: to-disconnect-a-custom-key-store-from-its-cloudhsm-cluster-1628627955156
92
+ * ```
93
+ *
83
94
  */
84
95
  export declare class DisconnectCustomKeyStoreCommand extends $Command<DisconnectCustomKeyStoreCommandInput, DisconnectCustomKeyStoreCommandOutput, KMSClientResolvedConfig> {
85
96
  readonly input: DisconnectCustomKeyStoreCommandInput;
@@ -39,6 +39,17 @@ export interface EnableKeyCommandOutput extends __MetadataBearer {
39
39
  * @see {@link EnableKeyCommandOutput} for command's `response` shape.
40
40
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
41
41
  *
42
+ * @example To enable a KMS key
43
+ * ```javascript
44
+ * // The following example enables the specified KMS key.
45
+ * const input = {
46
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
47
+ * };
48
+ * const command = new EnableKeyCommand(input);
49
+ * await client.send(command);
50
+ * // example id: to-enable-a-cmk-1478627501129
51
+ * ```
52
+ *
42
53
  */
43
54
  export declare class EnableKeyCommand extends $Command<EnableKeyCommandInput, EnableKeyCommandOutput, KMSClientResolvedConfig> {
44
55
  readonly input: EnableKeyCommandInput;
@@ -69,6 +69,17 @@ export interface EnableKeyRotationCommandOutput extends __MetadataBearer {
69
69
  * @see {@link EnableKeyRotationCommandOutput} for command's `response` shape.
70
70
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
71
71
  *
72
+ * @example To enable automatic rotation of key material
73
+ * ```javascript
74
+ * // The following example enables automatic annual rotation of the key material for the specified KMS key.
75
+ * const input = {
76
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
77
+ * };
78
+ * const command = new EnableKeyRotationCommand(input);
79
+ * await client.send(command);
80
+ * // example id: to-enable-automatic-rotation-of-key-material-1478629109677
81
+ * ```
82
+ *
72
83
  */
73
84
  export declare class EnableKeyRotationCommand extends $Command<EnableKeyRotationCommandInput, EnableKeyRotationCommandOutput, KMSClientResolvedConfig> {
74
85
  readonly input: EnableKeyRotationCommandInput;
@@ -138,6 +138,24 @@ export interface EncryptCommandOutput extends EncryptResponse, __MetadataBearer
138
138
  * @see {@link EncryptCommandOutput} for command's `response` shape.
139
139
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
140
140
  *
141
+ * @example To encrypt data
142
+ * ```javascript
143
+ * // The following example encrypts data with the specified KMS key.
144
+ * const input = {
145
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
146
+ * "Plaintext": "<binary data>"
147
+ * };
148
+ * const command = new EncryptCommand(input);
149
+ * const response = await client.send(command);
150
+ * /* response ==
151
+ * {
152
+ * "CiphertextBlob": "<binary data>",
153
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
154
+ * }
155
+ * *\/
156
+ * // example id: to-encrypt-data-1478906026012
157
+ * ```
158
+ *
141
159
  */
142
160
  export declare class EncryptCommand extends $Command<EncryptCommandInput, EncryptCommandOutput, KMSClientResolvedConfig> {
143
161
  readonly input: EncryptCommandInput;
@@ -122,6 +122,25 @@ export interface GenerateDataKeyCommandOutput extends GenerateDataKeyResponse, _
122
122
  * @see {@link GenerateDataKeyCommandOutput} for command's `response` shape.
123
123
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
124
124
  *
125
+ * @example To generate a data key
126
+ * ```javascript
127
+ * // The following example generates a 256-bit symmetric data encryption key (data key) in two formats. One is the unencrypted (plainext) data key, and the other is the data key encrypted with the specified KMS key.
128
+ * const input = {
129
+ * "KeyId": "alias/ExampleAlias",
130
+ * "KeySpec": "AES_256"
131
+ * };
132
+ * const command = new GenerateDataKeyCommand(input);
133
+ * const response = await client.send(command);
134
+ * /* response ==
135
+ * {
136
+ * "CiphertextBlob": "<binary data>",
137
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
138
+ * "Plaintext": "<binary data>"
139
+ * }
140
+ * *\/
141
+ * // example id: to-generate-a-data-key-1478912956062
142
+ * ```
143
+ *
125
144
  */
126
145
  export declare class GenerateDataKeyCommand extends $Command<GenerateDataKeyCommandInput, GenerateDataKeyCommandOutput, KMSClientResolvedConfig> {
127
146
  readonly input: GenerateDataKeyCommandInput;
@@ -99,6 +99,27 @@ export interface GenerateDataKeyPairCommandOutput extends GenerateDataKeyPairRes
99
99
  * @see {@link GenerateDataKeyPairCommandOutput} for command's `response` shape.
100
100
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
101
101
  *
102
+ * @example To generate an RSA key pair for encryption and decryption
103
+ * ```javascript
104
+ * // This example generates an RSA data key pair for encryption and decryption. The operation returns a plaintext public key and private key, and a copy of the private key that is encrypted under a symmetric encryption KMS key that you specify.
105
+ * const input = {
106
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
107
+ * "KeyPairSpec": "RSA_3072"
108
+ * };
109
+ * const command = new GenerateDataKeyPairCommand(input);
110
+ * const response = await client.send(command);
111
+ * /* response ==
112
+ * {
113
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
114
+ * "KeyPairSpec": "RSA_3072",
115
+ * "PrivateKeyCiphertextBlob": "<binary data>",
116
+ * "PrivateKeyPlaintext": "<binary data>",
117
+ * "PublicKey": "<binary data>"
118
+ * }
119
+ * *\/
120
+ * // example id: to-generate-an-rsa-key-pair-for-encryption-and-decryption-1628619376878
121
+ * ```
122
+ *
102
123
  */
103
124
  export declare class GenerateDataKeyPairCommand extends $Command<GenerateDataKeyPairCommandInput, GenerateDataKeyPairCommandOutput, KMSClientResolvedConfig> {
104
125
  readonly input: GenerateDataKeyPairCommandInput;
@@ -91,6 +91,26 @@ export interface GenerateDataKeyPairWithoutPlaintextCommandOutput extends Genera
91
91
  * @see {@link GenerateDataKeyPairWithoutPlaintextCommandOutput} for command's `response` shape.
92
92
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
93
93
  *
94
+ * @example To generate an asymmetric data key pair without a plaintext key
95
+ * ```javascript
96
+ * // This example returns an asymmetric elliptic curve (ECC) data key pair. The private key is encrypted under the symmetric encryption KMS key that you specify. This operation doesn't return a plaintext (unencrypted) private key.
97
+ * const input = {
98
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
99
+ * "KeyPairSpec": "ECC_NIST_P521"
100
+ * };
101
+ * const command = new GenerateDataKeyPairWithoutPlaintextCommand(input);
102
+ * const response = await client.send(command);
103
+ * /* response ==
104
+ * {
105
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
106
+ * "KeyPairSpec": "ECC_NIST_P521",
107
+ * "PrivateKeyCiphertextBlob": "<binary data>",
108
+ * "PublicKey": "<binary data>"
109
+ * }
110
+ * *\/
111
+ * // example id: to-generate-an-asymmetric-data-key-pair-without-a-plaintext-key-1628620971564
112
+ * ```
113
+ *
94
114
  */
95
115
  export declare class GenerateDataKeyPairWithoutPlaintextCommand extends $Command<GenerateDataKeyPairWithoutPlaintextCommandInput, GenerateDataKeyPairWithoutPlaintextCommandOutput, KMSClientResolvedConfig> {
96
116
  readonly input: GenerateDataKeyPairWithoutPlaintextCommandInput;
@@ -100,6 +100,24 @@ export interface GenerateDataKeyWithoutPlaintextCommandOutput extends GenerateDa
100
100
  * @see {@link GenerateDataKeyWithoutPlaintextCommandOutput} for command's `response` shape.
101
101
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
102
102
  *
103
+ * @example To generate an encrypted data key
104
+ * ```javascript
105
+ * // The following example generates an encrypted copy of a 256-bit symmetric data encryption key (data key). The data key is encrypted with the specified KMS key.
106
+ * const input = {
107
+ * "KeyId": "alias/ExampleAlias",
108
+ * "KeySpec": "AES_256"
109
+ * };
110
+ * const command = new GenerateDataKeyWithoutPlaintextCommand(input);
111
+ * const response = await client.send(command);
112
+ * /* response ==
113
+ * {
114
+ * "CiphertextBlob": "<binary data>",
115
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
116
+ * }
117
+ * *\/
118
+ * // example id: to-generate-an-encrypted-data-key-1478914121134
119
+ * ```
120
+ *
103
121
  */
104
122
  export declare class GenerateDataKeyWithoutPlaintextCommand extends $Command<GenerateDataKeyWithoutPlaintextCommandInput, GenerateDataKeyWithoutPlaintextCommandOutput, KMSClientResolvedConfig> {
105
123
  readonly input: GenerateDataKeyWithoutPlaintextCommandInput;
@@ -56,6 +56,26 @@ export interface GenerateMacCommandOutput extends GenerateMacResponse, __Metadat
56
56
  * @see {@link GenerateMacCommandOutput} for command's `response` shape.
57
57
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
58
58
  *
59
+ * @example To generate an HMAC for a message
60
+ * ```javascript
61
+ * // This example generates an HMAC for a message, an HMAC KMS key, and a MAC algorithm. The algorithm must be supported by the specified HMAC KMS key.
62
+ * const input = {
63
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
64
+ * "MacAlgorithm": "HMAC_SHA_384",
65
+ * "Message": "Hello World"
66
+ * };
67
+ * const command = new GenerateMacCommand(input);
68
+ * const response = await client.send(command);
69
+ * /* response ==
70
+ * {
71
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
72
+ * "Mac": "<HMAC_TAG>",
73
+ * "MacAlgorithm": "HMAC_SHA_384"
74
+ * }
75
+ * *\/
76
+ * // example id: to-generate-an-hmac-for-a-message-1631570135665
77
+ * ```
78
+ *
59
79
  */
60
80
  export declare class GenerateMacCommand extends $Command<GenerateMacCommandInput, GenerateMacCommandOutput, KMSClientResolvedConfig> {
61
81
  readonly input: GenerateMacCommandInput;
@@ -43,6 +43,22 @@ export interface GenerateRandomCommandOutput extends GenerateRandomResponse, __M
43
43
  * @see {@link GenerateRandomCommandOutput} for command's `response` shape.
44
44
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
45
45
  *
46
+ * @example To generate random data
47
+ * ```javascript
48
+ * // The following example generates 32 bytes of random data.
49
+ * const input = {
50
+ * "NumberOfBytes": 32
51
+ * };
52
+ * const command = new GenerateRandomCommand(input);
53
+ * const response = await client.send(command);
54
+ * /* response ==
55
+ * {
56
+ * "Plaintext": "<binary data>"
57
+ * }
58
+ * *\/
59
+ * // example id: to-generate-random-data-1479163645600
60
+ * ```
61
+ *
46
62
  */
47
63
  export declare class GenerateRandomCommand extends $Command<GenerateRandomCommandInput, GenerateRandomCommandOutput, KMSClientResolvedConfig> {
48
64
  readonly input: GenerateRandomCommandInput;
@@ -36,6 +36,23 @@ export interface GetKeyPolicyCommandOutput extends GetKeyPolicyResponse, __Metad
36
36
  * @see {@link GetKeyPolicyCommandOutput} for command's `response` shape.
37
37
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
38
38
  *
39
+ * @example To retrieve a key policy
40
+ * ```javascript
41
+ * // The following example retrieves the key policy for the specified KMS key.
42
+ * const input = {
43
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
44
+ * "PolicyName": "default"
45
+ * };
46
+ * const command = new GetKeyPolicyCommand(input);
47
+ * const response = await client.send(command);
48
+ * /* response ==
49
+ * {
50
+ * "Policy": "{\n \"Version\" : \"2012-10-17\",\n \"Id\" : \"key-default-1\",\n \"Statement\" : [ {\n \"Sid\" : \"Enable IAM User Permissions\",\n \"Effect\" : \"Allow\",\n \"Principal\" : {\n \"AWS\" : \"arn:aws:iam::111122223333:root\"\n },\n \"Action\" : \"kms:*\",\n \"Resource\" : \"*\"\n } ]\n}"
51
+ * }
52
+ * *\/
53
+ * // example id: to-retrieve-a-key-policy-1479170128325
54
+ * ```
55
+ *
39
56
  */
40
57
  export declare class GetKeyPolicyCommand extends $Command<GetKeyPolicyCommandInput, GetKeyPolicyCommandOutput, KMSClientResolvedConfig> {
41
58
  readonly input: GetKeyPolicyCommandInput;
@@ -81,6 +81,22 @@ export interface GetKeyRotationStatusCommandOutput extends GetKeyRotationStatusR
81
81
  * @see {@link GetKeyRotationStatusCommandOutput} for command's `response` shape.
82
82
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
83
83
  *
84
+ * @example To retrieve the rotation status for a KMS key
85
+ * ```javascript
86
+ * // The following example retrieves the status of automatic annual rotation of the key material for the specified KMS key.
87
+ * const input = {
88
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
89
+ * };
90
+ * const command = new GetKeyRotationStatusCommand(input);
91
+ * const response = await client.send(command);
92
+ * /* response ==
93
+ * {
94
+ * "KeyRotationEnabled": true
95
+ * }
96
+ * *\/
97
+ * // example id: to-retrieve-the-rotation-status-for-a-cmk-1479172287408
98
+ * ```
99
+ *
84
100
  */
85
101
  export declare class GetKeyRotationStatusCommand extends $Command<GetKeyRotationStatusCommandInput, GetKeyRotationStatusCommandOutput, KMSClientResolvedConfig> {
86
102
  readonly input: GetKeyRotationStatusCommandInput;
@@ -62,6 +62,27 @@ export interface GetParametersForImportCommandOutput extends GetParametersForImp
62
62
  * @see {@link GetParametersForImportCommandOutput} for command's `response` shape.
63
63
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
64
64
  *
65
+ * @example To retrieve the public key and import token for a KMS key
66
+ * ```javascript
67
+ * // The following example retrieves the public key and import token for the specified KMS key.
68
+ * const input = {
69
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
70
+ * "WrappingAlgorithm": "RSAES_OAEP_SHA_1",
71
+ * "WrappingKeySpec": "RSA_2048"
72
+ * };
73
+ * const command = new GetParametersForImportCommand(input);
74
+ * const response = await client.send(command);
75
+ * /* response ==
76
+ * {
77
+ * "ImportToken": "<binary data>",
78
+ * "KeyId": "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
79
+ * "ParametersValidTo": "2016-12-01T14:52:17-08:00",
80
+ * "PublicKey": "<binary data>"
81
+ * }
82
+ * *\/
83
+ * // example id: to-retrieve-the-public-key-and-import-token-for-a-cmk-1480626483211
84
+ * ```
85
+ *
65
86
  */
66
87
  export declare class GetParametersForImportCommand extends $Command<GetParametersForImportCommandInput, GetParametersForImportCommandOutput, KMSClientResolvedConfig> {
67
88
  readonly input: GetParametersForImportCommandInput;
@@ -77,6 +77,29 @@ export interface GetPublicKeyCommandOutput extends GetPublicKeyResponse, __Metad
77
77
  * @see {@link GetPublicKeyCommandOutput} for command's `response` shape.
78
78
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
79
79
  *
80
+ * @example To download the public key of an asymmetric KMS key
81
+ * ```javascript
82
+ * // This example gets the public key of an asymmetric RSA KMS key used for encryption and decryption. The operation returns the key spec, key usage, and encryption or signing algorithms to help you use the public key correctly outside of AWS KMS.
83
+ * const input = {
84
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321"
85
+ * };
86
+ * const command = new GetPublicKeyCommand(input);
87
+ * const response = await client.send(command);
88
+ * /* response ==
89
+ * {
90
+ * "CustomerMasterKeySpec": "RSA_4096",
91
+ * "EncryptionAlgorithms": [
92
+ * "RSAES_OAEP_SHA_1",
93
+ * "RSAES_OAEP_SHA_256"
94
+ * ],
95
+ * "KeyId": "arn:aws:kms:us-west-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321",
96
+ * "KeyUsage": "ENCRYPT_DECRYPT",
97
+ * "PublicKey": "<binary data>"
98
+ * }
99
+ * *\/
100
+ * // example id: to-download-the-public-key-of-an-asymmetric-kms-key-1628621691873
101
+ * ```
102
+ *
80
103
  */
81
104
  export declare class GetPublicKeyCommand extends $Command<GetPublicKeyCommandInput, GetPublicKeyCommandOutput, KMSClientResolvedConfig> {
82
105
  readonly input: GetPublicKeyCommandInput;
@@ -92,6 +92,20 @@ export interface ImportKeyMaterialCommandOutput extends ImportKeyMaterialRespons
92
92
  * @see {@link ImportKeyMaterialCommandOutput} for command's `response` shape.
93
93
  * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape.
94
94
  *
95
+ * @example To import key material into a KMS key
96
+ * ```javascript
97
+ * // The following example imports key material into the specified KMS key.
98
+ * const input = {
99
+ * "EncryptedKeyMaterial": "<binary data>",
100
+ * "ExpirationModel": "KEY_MATERIAL_DOES_NOT_EXPIRE",
101
+ * "ImportToken": "<binary data>",
102
+ * "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
103
+ * };
104
+ * const command = new ImportKeyMaterialCommand(input);
105
+ * await client.send(command);
106
+ * // example id: to-import-key-material-into-a-cmk-1480630551969
107
+ * ```
108
+ *
95
109
  */
96
110
  export declare class ImportKeyMaterialCommand extends $Command<ImportKeyMaterialCommandInput, ImportKeyMaterialCommandOutput, KMSClientResolvedConfig> {
97
111
  readonly input: ImportKeyMaterialCommandInput;