@aws-sdk/client-kms 3.321.1 → 3.324.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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.XksKeyInvalidConfigurationException = exports.XksKeyAlreadyInUseException = exports.UnsupportedOperationException = exports.TagException = exports.MalformedPolicyDocumentException = exports.SigningAlgorithmSpec = exports.MultiRegionKeyType = exports.MacAlgorithmSpec = exports.KeyState = exports.KeyManagerType = exports.ExpirationModelType = exports.EncryptionAlgorithmSpec = exports.OriginType = exports.KeyUsageType = exports.KeySpec = exports.CustomerMasterKeySpec = exports.InvalidGrantTokenException = exports.DisabledException = exports.GrantOperation = exports.XksProxyVpcEndpointServiceNotFoundException = exports.XksProxyVpcEndpointServiceInvalidConfigurationException = exports.XksProxyVpcEndpointServiceInUseException = exports.XksProxyUriUnreachableException = exports.XksProxyUriInUseException = exports.XksProxyUriEndpointInUseException = exports.XksProxyInvalidResponseException = exports.XksProxyInvalidConfigurationException = exports.XksProxyIncorrectAuthenticationCredentialException = exports.IncorrectTrustAnchorException = exports.CustomKeyStoreNameInUseException = exports.XksProxyConnectivityType = exports.CustomKeyStoreType = exports.LimitExceededException = exports.InvalidAliasNameException = exports.ConnectionStateType = exports.ConnectionErrorCodeType = exports.CustomKeyStoreNotFoundException = exports.CustomKeyStoreInvalidStateException = exports.CloudHsmClusterNotRelatedException = exports.CloudHsmClusterNotFoundException = exports.CloudHsmClusterNotActiveException = exports.CloudHsmClusterInvalidConfigurationException = exports.CloudHsmClusterInUseException = exports.NotFoundException = exports.KMSInvalidStateException = exports.KMSInternalException = exports.InvalidArnException = exports.DependencyTimeoutException = exports.AlreadyExistsException = exports.AlgorithmSpec = void 0;
4
- exports.VerifyMacRequestFilterSensitiveLog = exports.VerifyRequestFilterSensitiveLog = exports.UpdateCustomKeyStoreRequestFilterSensitiveLog = exports.SignRequestFilterSensitiveLog = exports.GetParametersForImportResponseFilterSensitiveLog = exports.GenerateRandomResponseFilterSensitiveLog = exports.GenerateMacRequestFilterSensitiveLog = exports.GenerateDataKeyPairResponseFilterSensitiveLog = exports.GenerateDataKeyResponseFilterSensitiveLog = exports.EncryptRequestFilterSensitiveLog = exports.DescribeCustomKeyStoresResponseFilterSensitiveLog = exports.DecryptResponseFilterSensitiveLog = exports.CustomKeyStoresListEntryFilterSensitiveLog = exports.XksProxyConfigurationTypeFilterSensitiveLog = exports.CreateCustomKeyStoreRequestFilterSensitiveLog = exports.XksProxyAuthenticationCredentialTypeFilterSensitiveLog = exports.MessageType = exports.KMSInvalidSignatureException = exports.KMSInvalidMacException = exports.InvalidGrantIdException = exports.InvalidImportTokenException = exports.IncorrectKeyMaterialException = exports.WrappingKeySpec = exports.ExpiredImportTokenException = exports.InvalidMarkerException = exports.KeyUnavailableException = exports.InvalidKeyUsageException = exports.InvalidCiphertextException = exports.IncorrectKeyException = exports.DataKeySpec = exports.DataKeyPairSpec = exports.CustomKeyStoreHasCMKsException = exports.XksKeyNotFoundException = void 0;
4
+ exports.VerifyMacRequestFilterSensitiveLog = exports.VerifyRequestFilterSensitiveLog = exports.UpdateCustomKeyStoreRequestFilterSensitiveLog = exports.SignRequestFilterSensitiveLog = exports.GetParametersForImportResponseFilterSensitiveLog = exports.GenerateRandomResponseFilterSensitiveLog = exports.GenerateMacRequestFilterSensitiveLog = exports.GenerateDataKeyPairResponseFilterSensitiveLog = exports.GenerateDataKeyResponseFilterSensitiveLog = exports.EncryptRequestFilterSensitiveLog = exports.DescribeCustomKeyStoresResponseFilterSensitiveLog = exports.DecryptResponseFilterSensitiveLog = exports.CustomKeyStoresListEntryFilterSensitiveLog = exports.XksProxyConfigurationTypeFilterSensitiveLog = exports.CreateCustomKeyStoreRequestFilterSensitiveLog = exports.XksProxyAuthenticationCredentialTypeFilterSensitiveLog = exports.MessageType = exports.KMSInvalidSignatureException = exports.KMSInvalidMacException = exports.InvalidGrantIdException = exports.InvalidImportTokenException = exports.IncorrectKeyMaterialException = exports.WrappingKeySpec = exports.ExpiredImportTokenException = exports.InvalidMarkerException = exports.KeyUnavailableException = exports.InvalidKeyUsageException = exports.InvalidCiphertextException = exports.IncorrectKeyException = exports.KeyEncryptionMechanism = exports.DataKeySpec = exports.DataKeyPairSpec = exports.CustomKeyStoreHasCMKsException = exports.XksKeyNotFoundException = void 0;
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const KMSServiceException_1 = require("./KMSServiceException");
7
7
  exports.AlgorithmSpec = {
@@ -618,6 +618,9 @@ exports.DataKeySpec = {
618
618
  AES_128: "AES_128",
619
619
  AES_256: "AES_256",
620
620
  };
621
+ exports.KeyEncryptionMechanism = {
622
+ RSAES_OAEP_SHA_256: "RSAES_OAEP_SHA_256",
623
+ };
621
624
  class IncorrectKeyException extends KMSServiceException_1.KMSServiceException {
622
625
  constructor(opts) {
623
626
  super({
@@ -135,14 +135,14 @@ exports.se_EncryptCommand = se_EncryptCommand;
135
135
  const se_GenerateDataKeyCommand = async (input, context) => {
136
136
  const headers = sharedHeaders("GenerateDataKey");
137
137
  let body;
138
- body = JSON.stringify((0, smithy_client_1._json)(input));
138
+ body = JSON.stringify(se_GenerateDataKeyRequest(input, context));
139
139
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
140
140
  };
141
141
  exports.se_GenerateDataKeyCommand = se_GenerateDataKeyCommand;
142
142
  const se_GenerateDataKeyPairCommand = async (input, context) => {
143
143
  const headers = sharedHeaders("GenerateDataKeyPair");
144
144
  let body;
145
- body = JSON.stringify((0, smithy_client_1._json)(input));
145
+ body = JSON.stringify(se_GenerateDataKeyPairRequest(input, context));
146
146
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
147
147
  };
148
148
  exports.se_GenerateDataKeyPairCommand = se_GenerateDataKeyPairCommand;
@@ -170,7 +170,7 @@ exports.se_GenerateMacCommand = se_GenerateMacCommand;
170
170
  const se_GenerateRandomCommand = async (input, context) => {
171
171
  const headers = sharedHeaders("GenerateRandom");
172
172
  let body;
173
- body = JSON.stringify((0, smithy_client_1._json)(input));
173
+ body = JSON.stringify(se_GenerateRandomRequest(input, context));
174
174
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
175
175
  };
176
176
  exports.se_GenerateRandomCommand = se_GenerateRandomCommand;
@@ -3279,6 +3279,7 @@ const se_DecryptRequest = (input, context) => {
3279
3279
  EncryptionContext: smithy_client_1._json,
3280
3280
  GrantTokens: smithy_client_1._json,
3281
3281
  KeyId: [],
3282
+ Recipient: (_) => se_RecipientInfo(_, context),
3282
3283
  });
3283
3284
  };
3284
3285
  const se_EncryptRequest = (input, context) => {
@@ -3290,6 +3291,25 @@ const se_EncryptRequest = (input, context) => {
3290
3291
  Plaintext: context.base64Encoder,
3291
3292
  });
3292
3293
  };
3294
+ const se_GenerateDataKeyPairRequest = (input, context) => {
3295
+ return (0, smithy_client_1.take)(input, {
3296
+ EncryptionContext: smithy_client_1._json,
3297
+ GrantTokens: smithy_client_1._json,
3298
+ KeyId: [],
3299
+ KeyPairSpec: [],
3300
+ Recipient: (_) => se_RecipientInfo(_, context),
3301
+ });
3302
+ };
3303
+ const se_GenerateDataKeyRequest = (input, context) => {
3304
+ return (0, smithy_client_1.take)(input, {
3305
+ EncryptionContext: smithy_client_1._json,
3306
+ GrantTokens: smithy_client_1._json,
3307
+ KeyId: [],
3308
+ KeySpec: [],
3309
+ NumberOfBytes: [],
3310
+ Recipient: (_) => se_RecipientInfo(_, context),
3311
+ });
3312
+ };
3293
3313
  const se_GenerateMacRequest = (input, context) => {
3294
3314
  return (0, smithy_client_1.take)(input, {
3295
3315
  GrantTokens: smithy_client_1._json,
@@ -3298,6 +3318,13 @@ const se_GenerateMacRequest = (input, context) => {
3298
3318
  Message: context.base64Encoder,
3299
3319
  });
3300
3320
  };
3321
+ const se_GenerateRandomRequest = (input, context) => {
3322
+ return (0, smithy_client_1.take)(input, {
3323
+ CustomKeyStoreId: [],
3324
+ NumberOfBytes: [],
3325
+ Recipient: (_) => se_RecipientInfo(_, context),
3326
+ });
3327
+ };
3301
3328
  const se_ImportKeyMaterialRequest = (input, context) => {
3302
3329
  return (0, smithy_client_1.take)(input, {
3303
3330
  EncryptedKeyMaterial: context.base64Encoder,
@@ -3307,6 +3334,12 @@ const se_ImportKeyMaterialRequest = (input, context) => {
3307
3334
  ValidTo: (_) => Math.round(_.getTime() / 1000),
3308
3335
  });
3309
3336
  };
3337
+ const se_RecipientInfo = (input, context) => {
3338
+ return (0, smithy_client_1.take)(input, {
3339
+ AttestationDocument: context.base64Encoder,
3340
+ KeyEncryptionAlgorithm: [],
3341
+ });
3342
+ };
3310
3343
  const se_ReEncryptRequest = (input, context) => {
3311
3344
  return (0, smithy_client_1.take)(input, {
3312
3345
  CiphertextBlob: context.base64Encoder,
@@ -3392,6 +3425,7 @@ const de_CustomKeyStoresListEntry = (output, context) => {
3392
3425
  };
3393
3426
  const de_DecryptResponse = (output, context) => {
3394
3427
  return (0, smithy_client_1.take)(output, {
3428
+ CiphertextForRecipient: context.base64Decoder,
3395
3429
  EncryptionAlgorithm: smithy_client_1.expectString,
3396
3430
  KeyId: smithy_client_1.expectString,
3397
3431
  Plaintext: context.base64Decoder,
@@ -3418,6 +3452,7 @@ const de_EncryptResponse = (output, context) => {
3418
3452
  };
3419
3453
  const de_GenerateDataKeyPairResponse = (output, context) => {
3420
3454
  return (0, smithy_client_1.take)(output, {
3455
+ CiphertextForRecipient: context.base64Decoder,
3421
3456
  KeyId: smithy_client_1.expectString,
3422
3457
  KeyPairSpec: smithy_client_1.expectString,
3423
3458
  PrivateKeyCiphertextBlob: context.base64Decoder,
@@ -3436,6 +3471,7 @@ const de_GenerateDataKeyPairWithoutPlaintextResponse = (output, context) => {
3436
3471
  const de_GenerateDataKeyResponse = (output, context) => {
3437
3472
  return (0, smithy_client_1.take)(output, {
3438
3473
  CiphertextBlob: context.base64Decoder,
3474
+ CiphertextForRecipient: context.base64Decoder,
3439
3475
  KeyId: smithy_client_1.expectString,
3440
3476
  Plaintext: context.base64Decoder,
3441
3477
  });
@@ -3455,6 +3491,7 @@ const de_GenerateMacResponse = (output, context) => {
3455
3491
  };
3456
3492
  const de_GenerateRandomResponse = (output, context) => {
3457
3493
  return (0, smithy_client_1.take)(output, {
3494
+ CiphertextForRecipient: context.base64Decoder,
3458
3495
  Plaintext: context.base64Decoder,
3459
3496
  });
3460
3497
  };
@@ -579,6 +579,9 @@ export const DataKeySpec = {
579
579
  AES_128: "AES_128",
580
580
  AES_256: "AES_256",
581
581
  };
582
+ export const KeyEncryptionMechanism = {
583
+ RSAES_OAEP_SHA_256: "RSAES_OAEP_SHA_256",
584
+ };
582
585
  export class IncorrectKeyException extends __BaseException {
583
586
  constructor(opts) {
584
587
  super({
@@ -113,13 +113,13 @@ export const se_EncryptCommand = async (input, context) => {
113
113
  export const se_GenerateDataKeyCommand = async (input, context) => {
114
114
  const headers = sharedHeaders("GenerateDataKey");
115
115
  let body;
116
- body = JSON.stringify(_json(input));
116
+ body = JSON.stringify(se_GenerateDataKeyRequest(input, context));
117
117
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
118
118
  };
119
119
  export const se_GenerateDataKeyPairCommand = async (input, context) => {
120
120
  const headers = sharedHeaders("GenerateDataKeyPair");
121
121
  let body;
122
- body = JSON.stringify(_json(input));
122
+ body = JSON.stringify(se_GenerateDataKeyPairRequest(input, context));
123
123
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
124
124
  };
125
125
  export const se_GenerateDataKeyPairWithoutPlaintextCommand = async (input, context) => {
@@ -143,7 +143,7 @@ export const se_GenerateMacCommand = async (input, context) => {
143
143
  export const se_GenerateRandomCommand = async (input, context) => {
144
144
  const headers = sharedHeaders("GenerateRandom");
145
145
  let body;
146
- body = JSON.stringify(_json(input));
146
+ body = JSON.stringify(se_GenerateRandomRequest(input, context));
147
147
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
148
148
  };
149
149
  export const se_GetKeyPolicyCommand = async (input, context) => {
@@ -3175,6 +3175,7 @@ const se_DecryptRequest = (input, context) => {
3175
3175
  EncryptionContext: _json,
3176
3176
  GrantTokens: _json,
3177
3177
  KeyId: [],
3178
+ Recipient: (_) => se_RecipientInfo(_, context),
3178
3179
  });
3179
3180
  };
3180
3181
  const se_EncryptRequest = (input, context) => {
@@ -3186,6 +3187,25 @@ const se_EncryptRequest = (input, context) => {
3186
3187
  Plaintext: context.base64Encoder,
3187
3188
  });
3188
3189
  };
3190
+ const se_GenerateDataKeyPairRequest = (input, context) => {
3191
+ return take(input, {
3192
+ EncryptionContext: _json,
3193
+ GrantTokens: _json,
3194
+ KeyId: [],
3195
+ KeyPairSpec: [],
3196
+ Recipient: (_) => se_RecipientInfo(_, context),
3197
+ });
3198
+ };
3199
+ const se_GenerateDataKeyRequest = (input, context) => {
3200
+ return take(input, {
3201
+ EncryptionContext: _json,
3202
+ GrantTokens: _json,
3203
+ KeyId: [],
3204
+ KeySpec: [],
3205
+ NumberOfBytes: [],
3206
+ Recipient: (_) => se_RecipientInfo(_, context),
3207
+ });
3208
+ };
3189
3209
  const se_GenerateMacRequest = (input, context) => {
3190
3210
  return take(input, {
3191
3211
  GrantTokens: _json,
@@ -3194,6 +3214,13 @@ const se_GenerateMacRequest = (input, context) => {
3194
3214
  Message: context.base64Encoder,
3195
3215
  });
3196
3216
  };
3217
+ const se_GenerateRandomRequest = (input, context) => {
3218
+ return take(input, {
3219
+ CustomKeyStoreId: [],
3220
+ NumberOfBytes: [],
3221
+ Recipient: (_) => se_RecipientInfo(_, context),
3222
+ });
3223
+ };
3197
3224
  const se_ImportKeyMaterialRequest = (input, context) => {
3198
3225
  return take(input, {
3199
3226
  EncryptedKeyMaterial: context.base64Encoder,
@@ -3203,6 +3230,12 @@ const se_ImportKeyMaterialRequest = (input, context) => {
3203
3230
  ValidTo: (_) => Math.round(_.getTime() / 1000),
3204
3231
  });
3205
3232
  };
3233
+ const se_RecipientInfo = (input, context) => {
3234
+ return take(input, {
3235
+ AttestationDocument: context.base64Encoder,
3236
+ KeyEncryptionAlgorithm: [],
3237
+ });
3238
+ };
3206
3239
  const se_ReEncryptRequest = (input, context) => {
3207
3240
  return take(input, {
3208
3241
  CiphertextBlob: context.base64Encoder,
@@ -3288,6 +3321,7 @@ const de_CustomKeyStoresListEntry = (output, context) => {
3288
3321
  };
3289
3322
  const de_DecryptResponse = (output, context) => {
3290
3323
  return take(output, {
3324
+ CiphertextForRecipient: context.base64Decoder,
3291
3325
  EncryptionAlgorithm: __expectString,
3292
3326
  KeyId: __expectString,
3293
3327
  Plaintext: context.base64Decoder,
@@ -3314,6 +3348,7 @@ const de_EncryptResponse = (output, context) => {
3314
3348
  };
3315
3349
  const de_GenerateDataKeyPairResponse = (output, context) => {
3316
3350
  return take(output, {
3351
+ CiphertextForRecipient: context.base64Decoder,
3317
3352
  KeyId: __expectString,
3318
3353
  KeyPairSpec: __expectString,
3319
3354
  PrivateKeyCiphertextBlob: context.base64Decoder,
@@ -3332,6 +3367,7 @@ const de_GenerateDataKeyPairWithoutPlaintextResponse = (output, context) => {
3332
3367
  const de_GenerateDataKeyResponse = (output, context) => {
3333
3368
  return take(output, {
3334
3369
  CiphertextBlob: context.base64Decoder,
3370
+ CiphertextForRecipient: context.base64Decoder,
3335
3371
  KeyId: __expectString,
3336
3372
  Plaintext: context.base64Decoder,
3337
3373
  });
@@ -3351,6 +3387,7 @@ const de_GenerateMacResponse = (output, context) => {
3351
3387
  };
3352
3388
  const de_GenerateRandomResponse = (output, context) => {
3353
3389
  return take(output, {
3390
+ CiphertextForRecipient: context.base64Decoder,
3354
3391
  Plaintext: context.base64Decoder,
3355
3392
  });
3356
3393
  };
@@ -73,7 +73,13 @@ export interface DecryptCommandOutput extends DecryptResponse, __MetadataBearer
73
73
  * an IAM policy for <code>Decrypt</code> permissions, limit the user to particular KMS keys or
74
74
  * particular trusted accounts. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policies-best-practices">Best practices for IAM
75
75
  * policies</a> in the <i>Key Management Service Developer Guide</i>.</p>
76
- * <p>Applications in Amazon Web Services Nitro Enclaves can call this operation by using the <a href="https://github.com/aws/aws-nitro-enclaves-sdk-c">Amazon Web Services Nitro Enclaves Development Kit</a>. For information about the supporting parameters, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves use KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
76
+ * <p>
77
+ * <code>Decrypt</code> also supports <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html">Amazon Web Services Nitro Enclaves</a>, which provide an
78
+ * isolated compute environment in Amazon EC2. To call <code>Decrypt</code> for a Nitro enclave, use
79
+ * the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK. Use the <code>Recipient</code> parameter to provide the
80
+ * attestation document for the enclave. Instead of the plaintext data, the response includes the
81
+ * plaintext data encrypted with the public key from the attestation document
82
+ * (<code>CiphertextForRecipient</code>).For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>..</p>
77
83
  * <p>The KMS key that you use for this operation must be in a compatible key state. For
78
84
  * details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
79
85
  * <p>
@@ -123,6 +129,10 @@ export interface DecryptCommandOutput extends DecryptResponse, __MetadataBearer
123
129
  * ],
124
130
  * KeyId: "STRING_VALUE",
125
131
  * EncryptionAlgorithm: "SYMMETRIC_DEFAULT" || "RSAES_OAEP_SHA_1" || "RSAES_OAEP_SHA_256" || "SM2PKE",
132
+ * Recipient: { // RecipientInfo
133
+ * KeyEncryptionAlgorithm: "RSAES_OAEP_SHA_256",
134
+ * AttestationDocument: "BLOB_VALUE",
135
+ * },
126
136
  * };
127
137
  * const command = new DecryptCommand(input);
128
138
  * const response = await client.send(command);
@@ -41,7 +41,15 @@ export interface GenerateDataKeyCommandOutput extends GenerateDataKeyResponse, _
41
41
  * encryption context (a case-sensitive exact match) when decrypting the encrypted data key.
42
42
  * Otherwise, the request to decrypt fails with an <code>InvalidCiphertextException</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption Context</a> in the
43
43
  * <i>Key Management Service Developer Guide</i>.</p>
44
- * <p>Applications in Amazon Web Services Nitro Enclaves can call this operation by using the <a href="https://github.com/aws/aws-nitro-enclaves-sdk-c">Amazon Web Services Nitro Enclaves Development Kit</a>. For information about the supporting parameters, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves use KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
44
+ * <p>
45
+ * <code>GenerateDataKey</code> also supports <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html">Amazon Web Services Nitro Enclaves</a>, which provide an
46
+ * isolated compute environment in Amazon EC2. To call <code>GenerateDataKey</code> for an Amazon Web Services Nitro
47
+ * enclave, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK. Use the <code>Recipient</code> parameter
48
+ * to provide the attestation document for the enclave. <code>GenerateDataKey</code> returns a
49
+ * copy of the data key encrypted under the specified KMS key, as usual. But instead of a
50
+ * plaintext copy of the data key, the response includes a copy of the data key encrypted under
51
+ * the public key from the attestation document (<code>CiphertextForRecipient</code>).
52
+ * For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>..</p>
45
53
  * <p>The KMS key that you use for this operation must be in a compatible key state. For
46
54
  * details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
47
55
  * <p>
@@ -129,6 +137,10 @@ export interface GenerateDataKeyCommandOutput extends GenerateDataKeyResponse, _
129
137
  * GrantTokens: [ // GrantTokenList
130
138
  * "STRING_VALUE",
131
139
  * ],
140
+ * Recipient: { // RecipientInfo
141
+ * KeyEncryptionAlgorithm: "RSAES_OAEP_SHA_256",
142
+ * AttestationDocument: "BLOB_VALUE",
143
+ * },
132
144
  * };
133
145
  * const command = new GenerateDataKeyCommand(input);
134
146
  * const response = await client.send(command);
@@ -48,6 +48,15 @@ export interface GenerateDataKeyPairCommandOutput extends GenerateDataKeyPairRes
48
48
  * to encrypt the private key. The public key is a DER-encoded X.509 SubjectPublicKeyInfo, as
49
49
  * specified in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>. The private
50
50
  * key is a DER-encoded PKCS8 PrivateKeyInfo, as specified in <a href="https://tools.ietf.org/html/rfc5958">RFC 5958</a>.</p>
51
+ * <p>
52
+ * <code>GenerateDataKeyPair</code> also supports <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html">Amazon Web Services Nitro Enclaves</a>, which provide an
53
+ * isolated compute environment in Amazon EC2. To call <code>GenerateDataKeyPair</code> for an Amazon Web Services Nitro
54
+ * enclave, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK. Use the <code>Recipient</code> parameter
55
+ * to provide the attestation document for the enclave. <code>GenerateDataKeyPair</code> returns the public data key and a
56
+ * copy of the private data key encrypted under the specified KMS key, as usual. But instead of a
57
+ * plaintext copy of the private data key (<code>PrivateKeyPlaintext</code>), the response includes a copy of the private data key encrypted under
58
+ * the public key from the attestation document (<code>CiphertextForRecipient</code>).
59
+ * For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>..</p>
51
60
  * <p>You can use an optional encryption context to add additional security to the encryption
52
61
  * operation. If you specify an <code>EncryptionContext</code>, you must specify the same
53
62
  * encryption context (a case-sensitive exact match) when decrypting the encrypted data key.
@@ -105,6 +114,10 @@ export interface GenerateDataKeyPairCommandOutput extends GenerateDataKeyPairRes
105
114
  * GrantTokens: [ // GrantTokenList
106
115
  * "STRING_VALUE",
107
116
  * ],
117
+ * Recipient: { // RecipientInfo
118
+ * KeyEncryptionAlgorithm: "RSAES_OAEP_SHA_256",
119
+ * AttestationDocument: "BLOB_VALUE",
120
+ * },
108
121
  * };
109
122
  * const command = new GenerateDataKeyPairCommand(input);
110
123
  * const response = await client.send(command);
@@ -44,7 +44,7 @@ export interface GenerateDataKeyWithoutPlaintextCommandOutput extends GenerateDa
44
44
  * <code>NumberOfBytes</code> parameters (but not both). For 128-bit and 256-bit data keys, use
45
45
  * the <code>KeySpec</code> parameter.</p>
46
46
  * <p>To generate an SM4 data key (China Regions only), specify a <code>KeySpec</code> value of
47
- * <code>AES_128</code> or <code>NumberOfBytes</code> value of <code>128</code>. The symmetric
47
+ * <code>AES_128</code> or <code>NumberOfBytes</code> value of <code>16</code>. The symmetric
48
48
  * encryption key used in China Regions to encrypt your data key is an SM4 encryption key.</p>
49
49
  * <p>If the operation succeeds, you will find the encrypted copy of the data key in the
50
50
  * <code>CiphertextBlob</code> field.</p>
@@ -25,7 +25,13 @@ export interface GenerateRandomCommandOutput extends GenerateRandomResponse, __M
25
25
  * <p>By default, the random byte string is generated in KMS. To generate the byte string in
26
26
  * the CloudHSM cluster associated with an CloudHSM key store, use the <code>CustomKeyStoreId</code>
27
27
  * parameter.</p>
28
- * <p>Applications in Amazon Web Services Nitro Enclaves can call this operation by using the <a href="https://github.com/aws/aws-nitro-enclaves-sdk-c">Amazon Web Services Nitro Enclaves Development Kit</a>. For information about the supporting parameters, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves use KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
28
+ * <p>
29
+ * <code>GenerateRandom</code> also supports <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html">Amazon Web Services Nitro Enclaves</a>, which provide an
30
+ * isolated compute environment in Amazon EC2. To call <code>GenerateRandom</code> for a Nitro
31
+ * enclave, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK. Use the <code>Recipient</code> parameter
32
+ * to provide the attestation document for the enclave. Instead of plaintext bytes, the response
33
+ * includes the plaintext bytes encrypted under the public key from the attestation document
34
+ * (<code>CiphertextForRecipient</code>).For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
29
35
  * <p>For more information about entropy and random number generation, see
30
36
  * <a href="https://docs.aws.amazon.com/kms/latest/cryptographic-details/">Key Management Service Cryptographic Details</a>.</p>
31
37
  * <p>
@@ -43,6 +49,10 @@ export interface GenerateRandomCommandOutput extends GenerateRandomResponse, __M
43
49
  * const input = { // GenerateRandomRequest
44
50
  * NumberOfBytes: Number("int"),
45
51
  * CustomKeyStoreId: "STRING_VALUE",
52
+ * Recipient: { // RecipientInfo
53
+ * KeyEncryptionAlgorithm: "RSAES_OAEP_SHA_256",
54
+ * AttestationDocument: "BLOB_VALUE",
55
+ * },
46
56
  * };
47
57
  * const command = new GenerateRandomCommand(input);
48
58
  * const response = await client.send(command);
@@ -394,6 +394,9 @@ export interface CreateAliasRequest {
394
394
  /**
395
395
  * <p>Specifies the alias name. This value must begin with <code>alias/</code> followed by a
396
396
  * name, such as <code>alias/ExampleAlias</code>. </p>
397
+ * <important>
398
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
399
+ * </important>
397
400
  * <p>The <code>AliasName</code> value must be string of 1-256 characters. It can contain only
398
401
  * alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name
399
402
  * cannot begin with <code>alias/aws/</code>. The <code>alias/aws/</code> prefix is reserved for
@@ -500,6 +503,9 @@ export interface CreateCustomKeyStoreRequest {
500
503
  /**
501
504
  * <p>Specifies a friendly name for the custom key store. The name must be unique in your
502
505
  * Amazon Web Services account and Region. This parameter is required for all custom key stores.</p>
506
+ * <important>
507
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
508
+ * </important>
503
509
  */
504
510
  CustomKeyStoreName: string | undefined;
505
511
  /**
@@ -945,19 +951,15 @@ export interface CreateGrantRequest {
945
951
  */
946
952
  Operations: (GrantOperation | string)[] | undefined;
947
953
  /**
948
- * <p>Specifies a grant constraint. </p>
954
+ * <p>Specifies a grant constraint.</p>
955
+ * <important>
956
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
957
+ * </important>
949
958
  * <p>KMS supports the <code>EncryptionContextEquals</code> and
950
- * <code>EncryptionContextSubset</code> grant constraints. Each constraint value can include up
951
- * to 8 encryption context pairs. The encryption context value in each constraint cannot exceed
952
- * 384 characters. For information about grant constraints, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints">Using grant
953
- * constraints</a> in the <i>Key Management Service Developer Guide</i>. For more information about encryption context,
954
- * see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption
955
- * context</a> in the <i>
956
- * <i>Key Management Service Developer Guide</i>
957
- * </i>. </p>
958
- * <p>The encryption context grant constraints allow the permissions in the grant only when the
959
- * encryption context in the request matches (<code>EncryptionContextEquals</code>) or includes
960
- * (<code>EncryptionContextSubset</code>) the encryption context specified in this structure. </p>
959
+ * <code>EncryptionContextSubset</code> grant constraints, which allow the permissions in the
960
+ * grant only when the encryption context in the request matches
961
+ * (<code>EncryptionContextEquals</code>) or includes (<code>EncryptionContextSubset</code>)
962
+ * the encryption context specified in the constraint. </p>
961
963
  * <p>The encryption context grant constraints are supported only on <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations">grant operations</a> that include
962
964
  * an <code>EncryptionContext</code> parameter, such as cryptographic operations on symmetric
963
965
  * encryption KMS keys. Grants with grant constraints can include the <a>DescribeKey</a> and <a>RetireGrant</a> operations, but the constraint doesn't apply to these
@@ -965,8 +967,16 @@ export interface CreateGrantRequest {
965
967
  * operation, the constraint requires that any grants created with the <code>CreateGrant</code>
966
968
  * permission have an equally strict or stricter encryption context constraint.</p>
967
969
  * <p>You cannot use an encryption context grant constraint for cryptographic operations with
968
- * asymmetric KMS keys or HMAC KMS keys. These keys don't support an encryption context. </p>
969
- * <p></p>
970
+ * asymmetric KMS keys or HMAC KMS keys. Operations with these keys don't support an encryption
971
+ * context.</p>
972
+ * <p>Each constraint value can include up to 8 encryption context pairs. The encryption context
973
+ * value in each constraint cannot exceed 384 characters. For information about grant
974
+ * constraints, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints">Using grant
975
+ * constraints</a> in the <i>Key Management Service Developer Guide</i>. For more information about encryption context,
976
+ * see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption
977
+ * context</a> in the <i>
978
+ * <i>Key Management Service Developer Guide</i>
979
+ * </i>. </p>
970
980
  */
971
981
  Constraints?: GrantConstraints;
972
982
  /**
@@ -978,6 +988,9 @@ export interface CreateGrantRequest {
978
988
  /**
979
989
  * <p>A friendly name for the grant. Use this value to prevent the unintended creation of
980
990
  * duplicate grants when retrying this request.</p>
991
+ * <important>
992
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
993
+ * </important>
981
994
  * <p>When this value is absent, all <code>CreateGrant</code> requests result in a new grant
982
995
  * with a unique <code>GrantId</code> even if all the supplied parameters are identical. This can
983
996
  * result in unintended duplicates when you retry the <code>CreateGrant</code> request.</p>
@@ -1106,6 +1119,9 @@ export type OriginType = (typeof OriginType)[keyof typeof OriginType];
1106
1119
  * @public
1107
1120
  * <p>A key-value pair. A tag consists of a tag key and a tag value. Tag keys and tag values are
1108
1121
  * both required, but tag values can be empty (null) strings.</p>
1122
+ * <important>
1123
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
1124
+ * </important>
1109
1125
  * <p>For information about the rules that apply to tag keys and tag values, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html">User-Defined Tag Restrictions</a> in the <i>Amazon Web Services Billing and Cost Management
1110
1126
  * User Guide</i>.</p>
1111
1127
  */
@@ -1152,9 +1168,11 @@ export interface CreateKeyRequest {
1152
1168
  */
1153
1169
  Policy?: string;
1154
1170
  /**
1155
- * <p>A description of the KMS key.</p>
1156
- * <p>Use a description that helps you decide whether the KMS key is appropriate for a task. The
1171
+ * <p>A description of the KMS key. Use a description that helps you decide whether the KMS key is appropriate for a task. The
1157
1172
  * default value is an empty string (no description).</p>
1173
+ * <important>
1174
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
1175
+ * </important>
1158
1176
  * <p>To set or change the description after the key is created, use <a>UpdateKeyDescription</a>.</p>
1159
1177
  */
1160
1178
  Description?: string;
@@ -1359,6 +1377,9 @@ export interface CreateKeyRequest {
1359
1377
  /**
1360
1378
  * <p>Assigns one or more tags to the KMS key. Use this parameter to tag the KMS key when it is
1361
1379
  * created. To tag an existing KMS key, use the <a>TagResource</a> operation.</p>
1380
+ * <important>
1381
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
1382
+ * </important>
1362
1383
  * <note>
1363
1384
  * <p>Tagging or untagging a KMS key can allow or deny permission to the KMS key. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/abac.html">ABAC for KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
1364
1385
  * </note>
@@ -2176,6 +2197,36 @@ export declare const DataKeySpec: {
2176
2197
  * @public
2177
2198
  */
2178
2199
  export type DataKeySpec = (typeof DataKeySpec)[keyof typeof DataKeySpec];
2200
+ /**
2201
+ * @public
2202
+ * @enum
2203
+ */
2204
+ export declare const KeyEncryptionMechanism: {
2205
+ readonly RSAES_OAEP_SHA_256: "RSAES_OAEP_SHA_256";
2206
+ };
2207
+ /**
2208
+ * @public
2209
+ */
2210
+ export type KeyEncryptionMechanism = (typeof KeyEncryptionMechanism)[keyof typeof KeyEncryptionMechanism];
2211
+ /**
2212
+ * @public
2213
+ * <p>Contains information about the party that receives the response from the API
2214
+ * operation.</p>
2215
+ * <p>This data type is designed to support Amazon Web Services Nitro Enclaves, which lets you create an isolated
2216
+ * compute environment in Amazon EC2. For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2217
+ */
2218
+ export interface RecipientInfo {
2219
+ /**
2220
+ * <p>The encryption algorithm that KMS should use with the public key for an Amazon Web Services Nitro Enclave to encrypt plaintext
2221
+ * values for the response. The only valid value is <code>RSAES_OAEP_SHA_256</code>.</p>
2222
+ */
2223
+ KeyEncryptionAlgorithm?: KeyEncryptionMechanism | string;
2224
+ /**
2225
+ * <p>The attestation document for an Amazon Web Services Nitro Enclave. This document includes the enclave's public
2226
+ * key.</p>
2227
+ */
2228
+ AttestationDocument?: Uint8Array;
2229
+ }
2179
2230
  /**
2180
2231
  * @public
2181
2232
  */
@@ -2241,6 +2292,20 @@ export interface DecryptRequest {
2241
2292
  * algorithm that is valid for symmetric encryption KMS keys.</p>
2242
2293
  */
2243
2294
  EncryptionAlgorithm?: EncryptionAlgorithmSpec | string;
2295
+ /**
2296
+ * <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from
2297
+ * an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key.
2298
+ * The only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>. </p>
2299
+ * <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this
2300
+ * parameter, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK.</p>
2301
+ * <p>When you use this parameter, instead of returning the plaintext data, KMS encrypts the
2302
+ * plaintext data with the public key in the attestation document, and returns the resulting
2303
+ * ciphertext in the <code>CiphertextForRecipient</code> field in the response. This ciphertext
2304
+ * can be decrypted only with the private key in the enclave. The <code>Plaintext</code> field in
2305
+ * the response is null or empty.</p>
2306
+ * <p>For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2307
+ */
2308
+ Recipient?: RecipientInfo;
2244
2309
  }
2245
2310
  /**
2246
2311
  * @public
@@ -2252,12 +2317,21 @@ export interface DecryptResponse {
2252
2317
  KeyId?: string;
2253
2318
  /**
2254
2319
  * <p>Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
2320
+ * <p>If the response includes the <code>CiphertextForRecipient</code> field, the
2321
+ * <code>Plaintext</code> field is null or empty.</p>
2255
2322
  */
2256
2323
  Plaintext?: Uint8Array;
2257
2324
  /**
2258
2325
  * <p>The encryption algorithm that was used to decrypt the ciphertext.</p>
2259
2326
  */
2260
2327
  EncryptionAlgorithm?: EncryptionAlgorithmSpec | string;
2328
+ /**
2329
+ * <p>The plaintext data encrypted with the public key in the attestation document. </p>
2330
+ * <p>This field is included in the response only when the <code>Recipient</code> parameter in
2331
+ * the request includes a valid attestation document from an Amazon Web Services Nitro enclave.
2332
+ * For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2333
+ */
2334
+ CiphertextForRecipient?: Uint8Array;
2261
2335
  }
2262
2336
  /**
2263
2337
  * @public
@@ -2640,6 +2714,9 @@ export interface EncryptRequest {
2640
2714
  /**
2641
2715
  * <p>Specifies the encryption context that will be used to encrypt the data.
2642
2716
  * An encryption context is valid only for <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic operations</a> with a symmetric encryption KMS key. The standard asymmetric encryption algorithms and HMAC algorithms that KMS uses do not support an encryption context. </p>
2717
+ * <important>
2718
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
2719
+ * </important>
2643
2720
  * <p>An <i>encryption context</i> is a collection of non-secret key-value pairs that represent additional authenticated data.
2644
2721
  * When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported
2645
2722
  * only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.</p>
@@ -2726,6 +2803,9 @@ export interface GenerateDataKeyRequest {
2726
2803
  KeyId: string | undefined;
2727
2804
  /**
2728
2805
  * <p>Specifies the encryption context that will be used when encrypting the data key.</p>
2806
+ * <important>
2807
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
2808
+ * </important>
2729
2809
  * <p>An <i>encryption context</i> is a collection of non-secret key-value pairs that represent additional authenticated data.
2730
2810
  * When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported
2731
2811
  * only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.</p>
@@ -2754,6 +2834,22 @@ export interface GenerateDataKeyRequest {
2754
2834
  * <i>Key Management Service Developer Guide</i>.</p>
2755
2835
  */
2756
2836
  GrantTokens?: string[];
2837
+ /**
2838
+ * <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from
2839
+ * an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key.
2840
+ * The only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>. </p>
2841
+ * <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this
2842
+ * parameter, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK.</p>
2843
+ * <p>When you use this parameter, instead of returning the plaintext data key, KMS encrypts
2844
+ * the plaintext data key under the public key in the attestation document, and returns the
2845
+ * resulting ciphertext in the <code>CiphertextForRecipient</code> field in the response. This
2846
+ * ciphertext can be decrypted only with the private key in the enclave. The
2847
+ * <code>CiphertextBlob</code> field in the response contains a copy of the data key encrypted
2848
+ * under the KMS key specified by the <code>KeyId</code> parameter. The <code>Plaintext</code>
2849
+ * field in the response is null or empty.</p>
2850
+ * <p>For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2851
+ */
2852
+ Recipient?: RecipientInfo;
2757
2853
  }
2758
2854
  /**
2759
2855
  * @public
@@ -2766,12 +2862,22 @@ export interface GenerateDataKeyResponse {
2766
2862
  /**
2767
2863
  * <p>The plaintext data key. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. Use this data key to encrypt your data outside of
2768
2864
  * KMS. Then, remove it from memory as soon as possible.</p>
2865
+ * <p>If the response includes the <code>CiphertextForRecipient</code> field, the
2866
+ * <code>Plaintext</code> field is null or empty.</p>
2769
2867
  */
2770
2868
  Plaintext?: Uint8Array;
2771
2869
  /**
2772
2870
  * <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that encrypted the data key.</p>
2773
2871
  */
2774
2872
  KeyId?: string;
2873
+ /**
2874
+ * <p>The plaintext data key encrypted with the public key from the Nitro enclave. This ciphertext can
2875
+ * be decrypted only by using a private key in the Nitro enclave. </p>
2876
+ * <p>This field is included in the response only when the <code>Recipient</code> parameter in
2877
+ * the request includes a valid attestation document from an Amazon Web Services Nitro enclave.
2878
+ * For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2879
+ */
2880
+ CiphertextForRecipient?: Uint8Array;
2775
2881
  }
2776
2882
  /**
2777
2883
  * @public
@@ -2780,6 +2886,9 @@ export interface GenerateDataKeyPairRequest {
2780
2886
  /**
2781
2887
  * <p>Specifies the encryption context that will be used when encrypting the private key in the
2782
2888
  * data key pair.</p>
2889
+ * <important>
2890
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
2891
+ * </important>
2783
2892
  * <p>An <i>encryption context</i> is a collection of non-secret key-value pairs that represent additional authenticated data.
2784
2893
  * When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported
2785
2894
  * only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.</p>
@@ -2825,6 +2934,22 @@ export interface GenerateDataKeyPairRequest {
2825
2934
  * <i>Key Management Service Developer Guide</i>.</p>
2826
2935
  */
2827
2936
  GrantTokens?: string[];
2937
+ /**
2938
+ * <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from
2939
+ * an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key.
2940
+ * The only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>. </p>
2941
+ * <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this
2942
+ * parameter, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK.</p>
2943
+ * <p>When you use this parameter, instead of returning a plaintext copy of the private data key, KMS encrypts
2944
+ * the plaintext private data key under the public key in the attestation document, and returns the
2945
+ * resulting ciphertext in the <code>CiphertextForRecipient</code> field in the response. This
2946
+ * ciphertext can be decrypted only with the private key in the enclave. The
2947
+ * <code>CiphertextBlob</code> field in the response contains a copy of the private data key encrypted
2948
+ * under the KMS key specified by the <code>KeyId</code> parameter. The <code>PrivateKeyPlaintext</code>
2949
+ * field in the response is null or empty.</p>
2950
+ * <p>For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2951
+ */
2952
+ Recipient?: RecipientInfo;
2828
2953
  }
2829
2954
  /**
2830
2955
  * @public
@@ -2836,6 +2961,8 @@ export interface GenerateDataKeyPairResponse {
2836
2961
  PrivateKeyCiphertextBlob?: Uint8Array;
2837
2962
  /**
2838
2963
  * <p>The plaintext copy of the private key. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
2964
+ * <p>If the response includes the <code>CiphertextForRecipient</code> field, the
2965
+ * <code>PrivateKeyPlaintext</code> field is null or empty.</p>
2839
2966
  */
2840
2967
  PrivateKeyPlaintext?: Uint8Array;
2841
2968
  /**
@@ -2850,6 +2977,14 @@ export interface GenerateDataKeyPairResponse {
2850
2977
  * <p>The type of data key pair that was generated.</p>
2851
2978
  */
2852
2979
  KeyPairSpec?: DataKeyPairSpec | string;
2980
+ /**
2981
+ * <p>The plaintext private data key encrypted with the public key from the Nitro enclave. This ciphertext can
2982
+ * be decrypted only by using a private key in the Nitro enclave. </p>
2983
+ * <p>This field is included in the response only when the <code>Recipient</code> parameter in
2984
+ * the request includes a valid attestation document from an Amazon Web Services Nitro enclave.
2985
+ * For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2986
+ */
2987
+ CiphertextForRecipient?: Uint8Array;
2853
2988
  }
2854
2989
  /**
2855
2990
  * @public
@@ -2858,6 +2993,9 @@ export interface GenerateDataKeyPairWithoutPlaintextRequest {
2858
2993
  /**
2859
2994
  * <p>Specifies the encryption context that will be used when encrypting the private key in the
2860
2995
  * data key pair.</p>
2996
+ * <important>
2997
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
2998
+ * </important>
2861
2999
  * <p>An <i>encryption context</i> is a collection of non-secret key-value pairs that represent additional authenticated data.
2862
3000
  * When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported
2863
3001
  * only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.</p>
@@ -2958,6 +3096,9 @@ export interface GenerateDataKeyWithoutPlaintextRequest {
2958
3096
  KeyId: string | undefined;
2959
3097
  /**
2960
3098
  * <p>Specifies the encryption context that will be used when encrypting the data key.</p>
3099
+ * <important>
3100
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
3101
+ * </important>
2961
3102
  * <p>An <i>encryption context</i> is a collection of non-secret key-value pairs that represent additional authenticated data.
2962
3103
  * When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported
2963
3104
  * only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.</p>
@@ -3061,9 +3202,23 @@ export interface GenerateRandomRequest {
3061
3202
  * specified CloudHSM key store. To find the ID of a custom key store, use the <a>DescribeCustomKeyStores</a> operation.</p>
3062
3203
  * <p>External key store IDs are not valid for this parameter. If you specify the ID of an
3063
3204
  * external key store, <code>GenerateRandom</code> throws an
3064
- * <code>UnsupportedOperationException</code>.</p>
3205
+ * <code>UnsupportedOperationException</code>.</p>
3065
3206
  */
3066
3207
  CustomKeyStoreId?: string;
3208
+ /**
3209
+ * <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from
3210
+ * an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key.
3211
+ * The only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>. </p>
3212
+ * <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this
3213
+ * parameter, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK.</p>
3214
+ * <p>When you use this parameter, instead of returning plaintext bytes, KMS encrypts the
3215
+ * plaintext bytes under the public key in the attestation document, and returns the resulting
3216
+ * ciphertext in the <code>CiphertextForRecipient</code> field in the response. This ciphertext
3217
+ * can be decrypted only with the private key in the enclave. The <code>Plaintext</code> field in
3218
+ * the response is null or empty.</p>
3219
+ * <p>For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
3220
+ */
3221
+ Recipient?: RecipientInfo;
3067
3222
  }
3068
3223
  /**
3069
3224
  * @public
@@ -3071,8 +3226,18 @@ export interface GenerateRandomRequest {
3071
3226
  export interface GenerateRandomResponse {
3072
3227
  /**
3073
3228
  * <p>The random byte string. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
3229
+ * <p>If the response includes the <code>CiphertextForRecipient</code> field, the
3230
+ * <code>Plaintext</code> field is null or empty.</p>
3074
3231
  */
3075
3232
  Plaintext?: Uint8Array;
3233
+ /**
3234
+ * <p>The plaintext random bytes encrypted with the public key from the Nitro enclave. This ciphertext can
3235
+ * be decrypted only by using a private key in the Nitro enclave. </p>
3236
+ * <p>This field is included in the response only when the <code>Recipient</code> parameter in
3237
+ * the request includes a valid attestation document from an Amazon Web Services Nitro enclave.
3238
+ * For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
3239
+ */
3240
+ CiphertextForRecipient?: Uint8Array;
3076
3241
  }
3077
3242
  /**
3078
3243
  * @public
@@ -3986,6 +4151,9 @@ export interface ReEncryptRequest {
3986
4151
  DestinationKeyId: string | undefined;
3987
4152
  /**
3988
4153
  * <p>Specifies that encryption context to use when the reencrypting the data.</p>
4154
+ * <important>
4155
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
4156
+ * </important>
3989
4157
  * <p>A destination encryption context is valid only when the destination KMS key is a symmetric
3990
4158
  * encryption KMS key. The standard ciphertext format for asymmetric KMS keys does not include
3991
4159
  * fields for metadata.</p>
@@ -4146,6 +4314,9 @@ export interface ReplicateKeyRequest {
4146
4314
  /**
4147
4315
  * <p>A description of the KMS key. The default value is an empty string (no
4148
4316
  * description).</p>
4317
+ * <important>
4318
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
4319
+ * </important>
4149
4320
  * <p>The description is not a shared property of multi-Region keys. You can specify the same
4150
4321
  * description or a different description for each key in a set of related multi-Region keys.
4151
4322
  * KMS does not synchronize this property.</p>
@@ -4155,6 +4326,9 @@ export interface ReplicateKeyRequest {
4155
4326
  * <p>Assigns one or more tags to the replica key. Use this parameter to tag the KMS key when it
4156
4327
  * is created. To tag an existing KMS key, use the <a>TagResource</a>
4157
4328
  * operation.</p>
4329
+ * <important>
4330
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
4331
+ * </important>
4158
4332
  * <note>
4159
4333
  * <p>Tagging or untagging a KMS key can allow or deny permission to the KMS key. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/abac.html">ABAC for KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
4160
4334
  * </note>
@@ -4453,9 +4627,11 @@ export interface TagResourceRequest {
4453
4627
  */
4454
4628
  KeyId: string | undefined;
4455
4629
  /**
4456
- * <p>One or more tags. </p>
4457
- * <p>Each tag consists of a tag key and a tag value. The tag value can be an empty (null)
4630
+ * <p>One or more tags. Each tag consists of a tag key and a tag value. The tag value can be an empty (null)
4458
4631
  * string. </p>
4632
+ * <important>
4633
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
4634
+ * </important>
4459
4635
  * <p>You cannot have more than one tag on a KMS key with the same tag key. If you specify an
4460
4636
  * existing tag key with a different tag value, KMS replaces the current tag value with the
4461
4637
  * specified one.</p>
@@ -4496,6 +4672,9 @@ export interface UpdateAliasRequest {
4496
4672
  * <p>Identifies the alias that is changing its KMS key. This value must begin with
4497
4673
  * <code>alias/</code> followed by the alias name, such as <code>alias/ExampleAlias</code>. You
4498
4674
  * cannot use <code>UpdateAlias</code> to change the alias name.</p>
4675
+ * <important>
4676
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
4677
+ * </important>
4499
4678
  */
4500
4679
  AliasName: string | undefined;
4501
4680
  /**
@@ -4533,6 +4712,9 @@ export interface UpdateCustomKeyStoreRequest {
4533
4712
  /**
4534
4713
  * <p>Changes the friendly name of the custom key store to the value that you specify. The
4535
4714
  * custom key store name must be unique in the Amazon Web Services account.</p>
4715
+ * <important>
4716
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
4717
+ * </important>
4536
4718
  * <p>To change this value, an CloudHSM key store must be disconnected. An external key store can
4537
4719
  * be connected or disconnected.</p>
4538
4720
  */
@@ -4651,6 +4833,9 @@ export interface UpdateKeyDescriptionRequest {
4651
4833
  KeyId: string | undefined;
4652
4834
  /**
4653
4835
  * <p>New description for the KMS key.</p>
4836
+ * <important>
4837
+ * <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
4838
+ * </important>
4654
4839
  */
4655
4840
  Description: string | undefined;
4656
4841
  }
@@ -614,17 +614,28 @@ export declare const DataKeySpec: {
614
614
  readonly AES_256: "AES_256";
615
615
  };
616
616
  export type DataKeySpec = (typeof DataKeySpec)[keyof typeof DataKeySpec];
617
+ export declare const KeyEncryptionMechanism: {
618
+ readonly RSAES_OAEP_SHA_256: "RSAES_OAEP_SHA_256";
619
+ };
620
+ export type KeyEncryptionMechanism =
621
+ (typeof KeyEncryptionMechanism)[keyof typeof KeyEncryptionMechanism];
622
+ export interface RecipientInfo {
623
+ KeyEncryptionAlgorithm?: KeyEncryptionMechanism | string;
624
+ AttestationDocument?: Uint8Array;
625
+ }
617
626
  export interface DecryptRequest {
618
627
  CiphertextBlob: Uint8Array | undefined;
619
628
  EncryptionContext?: Record<string, string>;
620
629
  GrantTokens?: string[];
621
630
  KeyId?: string;
622
631
  EncryptionAlgorithm?: EncryptionAlgorithmSpec | string;
632
+ Recipient?: RecipientInfo;
623
633
  }
624
634
  export interface DecryptResponse {
625
635
  KeyId?: string;
626
636
  Plaintext?: Uint8Array;
627
637
  EncryptionAlgorithm?: EncryptionAlgorithmSpec | string;
638
+ CiphertextForRecipient?: Uint8Array;
628
639
  }
629
640
  export declare class IncorrectKeyException extends __BaseException {
630
641
  readonly name: "IncorrectKeyException";
@@ -730,17 +741,20 @@ export interface GenerateDataKeyRequest {
730
741
  NumberOfBytes?: number;
731
742
  KeySpec?: DataKeySpec | string;
732
743
  GrantTokens?: string[];
744
+ Recipient?: RecipientInfo;
733
745
  }
734
746
  export interface GenerateDataKeyResponse {
735
747
  CiphertextBlob?: Uint8Array;
736
748
  Plaintext?: Uint8Array;
737
749
  KeyId?: string;
750
+ CiphertextForRecipient?: Uint8Array;
738
751
  }
739
752
  export interface GenerateDataKeyPairRequest {
740
753
  EncryptionContext?: Record<string, string>;
741
754
  KeyId: string | undefined;
742
755
  KeyPairSpec: DataKeyPairSpec | string | undefined;
743
756
  GrantTokens?: string[];
757
+ Recipient?: RecipientInfo;
744
758
  }
745
759
  export interface GenerateDataKeyPairResponse {
746
760
  PrivateKeyCiphertextBlob?: Uint8Array;
@@ -748,6 +762,7 @@ export interface GenerateDataKeyPairResponse {
748
762
  PublicKey?: Uint8Array;
749
763
  KeyId?: string;
750
764
  KeyPairSpec?: DataKeyPairSpec | string;
765
+ CiphertextForRecipient?: Uint8Array;
751
766
  }
752
767
  export interface GenerateDataKeyPairWithoutPlaintextRequest {
753
768
  EncryptionContext?: Record<string, string>;
@@ -786,9 +801,11 @@ export interface GenerateMacResponse {
786
801
  export interface GenerateRandomRequest {
787
802
  NumberOfBytes?: number;
788
803
  CustomKeyStoreId?: string;
804
+ Recipient?: RecipientInfo;
789
805
  }
790
806
  export interface GenerateRandomResponse {
791
807
  Plaintext?: Uint8Array;
808
+ CiphertextForRecipient?: Uint8Array;
792
809
  }
793
810
  export interface GetKeyPolicyRequest {
794
811
  KeyId: string | undefined;
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.321.1",
4
+ "version": "3.324.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",