@aws-sdk/client-kms 3.72.0 → 3.73.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 (64) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +4 -1
  3. package/dist-cjs/KMS.js +30 -0
  4. package/dist-cjs/commands/GenerateMacCommand.js +36 -0
  5. package/dist-cjs/commands/VerifyMacCommand.js +36 -0
  6. package/dist-cjs/commands/index.js +2 -0
  7. package/dist-cjs/models/models_0.js +60 -3
  8. package/dist-cjs/protocols/Aws_json1_1.js +194 -2
  9. package/dist-es/KMS.js +30 -0
  10. package/dist-es/commands/GenerateMacCommand.js +39 -0
  11. package/dist-es/commands/VerifyMacCommand.js +39 -0
  12. package/dist-es/commands/index.js +2 -0
  13. package/dist-es/models/models_0.js +46 -0
  14. package/dist-es/protocols/Aws_json1_1.js +225 -1
  15. package/dist-types/KMS.d.ts +256 -219
  16. package/dist-types/KMSClient.d.ts +8 -3
  17. package/dist-types/commands/CancelKeyDeletionCommand.d.ts +1 -1
  18. package/dist-types/commands/CreateAliasCommand.d.ts +2 -2
  19. package/dist-types/commands/CreateGrantCommand.d.ts +2 -2
  20. package/dist-types/commands/CreateKeyCommand.d.ts +44 -40
  21. package/dist-types/commands/DecryptCommand.d.ts +7 -7
  22. package/dist-types/commands/DeleteAliasCommand.d.ts +1 -1
  23. package/dist-types/commands/DeleteImportedKeyMaterialCommand.d.ts +1 -1
  24. package/dist-types/commands/DescribeKeyCommand.d.ts +6 -8
  25. package/dist-types/commands/DisableKeyCommand.d.ts +2 -3
  26. package/dist-types/commands/DisableKeyRotationCommand.d.ts +3 -3
  27. package/dist-types/commands/EnableKeyCommand.d.ts +1 -1
  28. package/dist-types/commands/EnableKeyRotationCommand.d.ts +3 -3
  29. package/dist-types/commands/EncryptCommand.d.ts +8 -26
  30. package/dist-types/commands/GenerateDataKeyCommand.d.ts +13 -15
  31. package/dist-types/commands/GenerateDataKeyPairCommand.d.ts +12 -11
  32. package/dist-types/commands/GenerateDataKeyPairWithoutPlaintextCommand.d.ts +10 -11
  33. package/dist-types/commands/GenerateDataKeyWithoutPlaintextCommand.d.ts +21 -24
  34. package/dist-types/commands/GenerateMacCommand.d.ts +55 -0
  35. package/dist-types/commands/GetKeyRotationStatusCommand.d.ts +2 -2
  36. package/dist-types/commands/GetParametersForImportCommand.d.ts +7 -7
  37. package/dist-types/commands/GetPublicKeyCommand.d.ts +2 -2
  38. package/dist-types/commands/ImportKeyMaterialCommand.d.ts +8 -8
  39. package/dist-types/commands/ListGrantsCommand.d.ts +1 -1
  40. package/dist-types/commands/ListRetirableGrantsCommand.d.ts +1 -1
  41. package/dist-types/commands/ReEncryptCommand.d.ts +8 -9
  42. package/dist-types/commands/ReplicateKeyCommand.d.ts +8 -4
  43. package/dist-types/commands/RetireGrantCommand.d.ts +4 -5
  44. package/dist-types/commands/RevokeGrantCommand.d.ts +1 -1
  45. package/dist-types/commands/ScheduleKeyDeletionCommand.d.ts +1 -1
  46. package/dist-types/commands/SignCommand.d.ts +3 -3
  47. package/dist-types/commands/TagResourceCommand.d.ts +2 -2
  48. package/dist-types/commands/UntagResourceCommand.d.ts +2 -2
  49. package/dist-types/commands/UpdateAliasCommand.d.ts +2 -2
  50. package/dist-types/commands/UpdateKeyDescriptionCommand.d.ts +1 -1
  51. package/dist-types/commands/UpdatePrimaryRegionCommand.d.ts +2 -3
  52. package/dist-types/commands/VerifyCommand.d.ts +2 -2
  53. package/dist-types/commands/VerifyMacCommand.d.ts +56 -0
  54. package/dist-types/commands/index.d.ts +2 -0
  55. package/dist-types/models/models_0.d.ts +323 -114
  56. package/dist-types/protocols/Aws_json1_1.d.ts +6 -0
  57. package/dist-types/ts3.4/KMS.d.ts +10 -0
  58. package/dist-types/ts3.4/KMSClient.d.ts +4 -2
  59. package/dist-types/ts3.4/commands/GenerateMacCommand.d.ts +17 -0
  60. package/dist-types/ts3.4/commands/VerifyMacCommand.d.ts +17 -0
  61. package/dist-types/ts3.4/commands/index.d.ts +2 -0
  62. package/dist-types/ts3.4/models/models_0.d.ts +81 -1
  63. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +6 -0
  64. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.73.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.72.0...v3.73.0) (2022-04-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * **client-kms:** Adds support for KMS keys and APIs that generate and verify HMAC codes ([90a9a16](https://github.com/aws/aws-sdk-js-v3/commit/90a9a16314deb5df692167e002fcdbb3f60025c2))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.72.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.71.0...v3.72.0) (2022-04-15)
7
18
 
8
19
  **Note:** Version bump only for package @aws-sdk/client-kms
package/README.md CHANGED
@@ -24,7 +24,10 @@ retrying requests automatically. For more information about the Amazon Web Servi
24
24
  download and install them, see <a href="http://aws.amazon.com/tools/">Tools for Amazon Web
25
25
  Services</a>.</p>
26
26
  </note>
27
- <p>We recommend that you use the Amazon Web Services SDKs to make programmatic API calls to KMS.</p>
27
+ <p>We recommend that you use the Amazon Web Services SDKs to make programmatic API calls to KMS. </p>
28
+ <p>If you need to use FIPS 140-2 validated cryptographic modules when communicating with
29
+ Amazon Web Services, use the FIPS endpoint in your preferred Amazon Web Services Region. For more information about the
30
+ available FIPS endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region">Service endpoints</a> in the Key Management Service topic of the <i>Amazon Web Services General Reference</i>.</p>
28
31
  <p>Clients must support TLS (Transport Layer Security) 1.0. We recommend TLS 1.2. Clients
29
32
  must also support cipher suites with Perfect Forward Secrecy (PFS) such as Ephemeral
30
33
  Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman (ECDHE). Most modern systems
package/dist-cjs/KMS.js CHANGED
@@ -23,6 +23,7 @@ const GenerateDataKeyCommand_1 = require("./commands/GenerateDataKeyCommand");
23
23
  const GenerateDataKeyPairCommand_1 = require("./commands/GenerateDataKeyPairCommand");
24
24
  const GenerateDataKeyPairWithoutPlaintextCommand_1 = require("./commands/GenerateDataKeyPairWithoutPlaintextCommand");
25
25
  const GenerateDataKeyWithoutPlaintextCommand_1 = require("./commands/GenerateDataKeyWithoutPlaintextCommand");
26
+ const GenerateMacCommand_1 = require("./commands/GenerateMacCommand");
26
27
  const GenerateRandomCommand_1 = require("./commands/GenerateRandomCommand");
27
28
  const GetKeyPolicyCommand_1 = require("./commands/GetKeyPolicyCommand");
28
29
  const GetKeyRotationStatusCommand_1 = require("./commands/GetKeyRotationStatusCommand");
@@ -49,6 +50,7 @@ const UpdateCustomKeyStoreCommand_1 = require("./commands/UpdateCustomKeyStoreCo
49
50
  const UpdateKeyDescriptionCommand_1 = require("./commands/UpdateKeyDescriptionCommand");
50
51
  const UpdatePrimaryRegionCommand_1 = require("./commands/UpdatePrimaryRegionCommand");
51
52
  const VerifyCommand_1 = require("./commands/VerifyCommand");
53
+ const VerifyMacCommand_1 = require("./commands/VerifyMacCommand");
52
54
  const KMSClient_1 = require("./KMSClient");
53
55
  class KMS extends KMSClient_1.KMSClient {
54
56
  cancelKeyDeletion(args, optionsOrCb, cb) {
@@ -359,6 +361,20 @@ class KMS extends KMSClient_1.KMSClient {
359
361
  return this.send(command, optionsOrCb);
360
362
  }
361
363
  }
364
+ generateMac(args, optionsOrCb, cb) {
365
+ const command = new GenerateMacCommand_1.GenerateMacCommand(args);
366
+ if (typeof optionsOrCb === "function") {
367
+ this.send(command, optionsOrCb);
368
+ }
369
+ else if (typeof cb === "function") {
370
+ if (typeof optionsOrCb !== "object")
371
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
372
+ this.send(command, optionsOrCb || {}, cb);
373
+ }
374
+ else {
375
+ return this.send(command, optionsOrCb);
376
+ }
377
+ }
362
378
  generateRandom(args, optionsOrCb, cb) {
363
379
  const command = new GenerateRandomCommand_1.GenerateRandomCommand(args);
364
380
  if (typeof optionsOrCb === "function") {
@@ -723,5 +739,19 @@ class KMS extends KMSClient_1.KMSClient {
723
739
  return this.send(command, optionsOrCb);
724
740
  }
725
741
  }
742
+ verifyMac(args, optionsOrCb, cb) {
743
+ const command = new VerifyMacCommand_1.VerifyMacCommand(args);
744
+ if (typeof optionsOrCb === "function") {
745
+ this.send(command, optionsOrCb);
746
+ }
747
+ else if (typeof cb === "function") {
748
+ if (typeof optionsOrCb !== "object")
749
+ throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
750
+ this.send(command, optionsOrCb || {}, cb);
751
+ }
752
+ else {
753
+ return this.send(command, optionsOrCb);
754
+ }
755
+ }
726
756
  }
727
757
  exports.KMS = KMS;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenerateMacCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
+ class GenerateMacCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "KMSClient";
18
+ const commandName = "GenerateMacCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.GenerateMacRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.GenerateMacResponse.filterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_json1_1_1.serializeAws_json1_1GenerateMacCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_json1_1_1.deserializeAws_json1_1GenerateMacCommand)(output, context);
34
+ }
35
+ }
36
+ exports.GenerateMacCommand = GenerateMacCommand;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VerifyMacCommand = void 0;
4
+ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
+ class VerifyMacCommand extends smithy_client_1.Command {
9
+ constructor(input) {
10
+ super();
11
+ this.input = input;
12
+ }
13
+ resolveMiddleware(clientStack, configuration, options) {
14
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
15
+ const stack = clientStack.concat(this.middlewareStack);
16
+ const { logger } = configuration;
17
+ const clientName = "KMSClient";
18
+ const commandName = "VerifyMacCommand";
19
+ const handlerExecutionContext = {
20
+ logger,
21
+ clientName,
22
+ commandName,
23
+ inputFilterSensitiveLog: models_0_1.VerifyMacRequest.filterSensitiveLog,
24
+ outputFilterSensitiveLog: models_0_1.VerifyMacResponse.filterSensitiveLog,
25
+ };
26
+ const { requestHandler } = configuration;
27
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
28
+ }
29
+ serialize(input, context) {
30
+ return (0, Aws_json1_1_1.serializeAws_json1_1VerifyMacCommand)(input, context);
31
+ }
32
+ deserialize(output, context) {
33
+ return (0, Aws_json1_1_1.deserializeAws_json1_1VerifyMacCommand)(output, context);
34
+ }
35
+ }
36
+ exports.VerifyMacCommand = VerifyMacCommand;
@@ -23,6 +23,7 @@ tslib_1.__exportStar(require("./GenerateDataKeyCommand"), exports);
23
23
  tslib_1.__exportStar(require("./GenerateDataKeyPairCommand"), exports);
24
24
  tslib_1.__exportStar(require("./GenerateDataKeyPairWithoutPlaintextCommand"), exports);
25
25
  tslib_1.__exportStar(require("./GenerateDataKeyWithoutPlaintextCommand"), exports);
26
+ tslib_1.__exportStar(require("./GenerateMacCommand"), exports);
26
27
  tslib_1.__exportStar(require("./GenerateRandomCommand"), exports);
27
28
  tslib_1.__exportStar(require("./GetKeyPolicyCommand"), exports);
28
29
  tslib_1.__exportStar(require("./GetKeyRotationStatusCommand"), exports);
@@ -49,3 +50,4 @@ tslib_1.__exportStar(require("./UpdateCustomKeyStoreCommand"), exports);
49
50
  tslib_1.__exportStar(require("./UpdateKeyDescriptionCommand"), exports);
50
51
  tslib_1.__exportStar(require("./UpdatePrimaryRegionCommand"), exports);
51
52
  tslib_1.__exportStar(require("./VerifyCommand"), exports);
53
+ tslib_1.__exportStar(require("./VerifyMacCommand"), exports);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateKeyResponse = exports.KeyMetadata = exports.SigningAlgorithmSpec = exports.MultiRegionConfiguration = exports.MultiRegionKey = exports.MultiRegionKeyType = exports.KeyState = exports.KeyManagerType = exports.ExpirationModelType = exports.EncryptionAlgorithmSpec = exports.CreateKeyRequest = exports.Tag = exports.OriginType = exports.KeyUsageType = exports.KeySpec = exports.CustomerMasterKeySpec = exports.InvalidGrantTokenException = exports.DisabledException = exports.CreateGrantResponse = exports.CreateGrantRequest = exports.GrantOperation = exports.GrantConstraints = exports.IncorrectTrustAnchorException = exports.CustomKeyStoreNameInUseException = exports.CreateCustomKeyStoreResponse = exports.CreateCustomKeyStoreRequest = exports.LimitExceededException = exports.InvalidAliasNameException = exports.CreateAliasRequest = exports.ConnectionStateType = exports.ConnectionErrorCodeType = exports.CustomKeyStoreNotFoundException = exports.CustomKeyStoreInvalidStateException = exports.ConnectCustomKeyStoreResponse = exports.ConnectCustomKeyStoreRequest = exports.CloudHsmClusterNotRelatedException = exports.CloudHsmClusterNotFoundException = exports.CloudHsmClusterNotActiveException = exports.CloudHsmClusterInvalidConfigurationException = exports.CloudHsmClusterInUseException = exports.NotFoundException = exports.KMSInvalidStateException = exports.KMSInternalException = exports.InvalidArnException = exports.DependencyTimeoutException = exports.CancelKeyDeletionResponse = exports.CancelKeyDeletionRequest = exports.AlreadyExistsException = exports.AliasListEntry = exports.AlgorithmSpec = void 0;
4
- exports.GetPublicKeyResponse = exports.GetPublicKeyRequest = exports.GetParametersForImportResponse = exports.GetParametersForImportRequest = exports.WrappingKeySpec = exports.GetKeyRotationStatusResponse = exports.GetKeyRotationStatusRequest = exports.GetKeyPolicyResponse = exports.GetKeyPolicyRequest = exports.GenerateRandomResponse = exports.GenerateRandomRequest = exports.GenerateDataKeyWithoutPlaintextResponse = exports.GenerateDataKeyWithoutPlaintextRequest = exports.GenerateDataKeyPairWithoutPlaintextResponse = exports.GenerateDataKeyPairWithoutPlaintextRequest = exports.GenerateDataKeyPairResponse = exports.GenerateDataKeyPairRequest = exports.GenerateDataKeyResponse = exports.GenerateDataKeyRequest = exports.ExpiredImportTokenException = exports.EncryptResponse = exports.EncryptRequest = exports.EnableKeyRotationRequest = exports.EnableKeyRequest = exports.DisconnectCustomKeyStoreResponse = exports.DisconnectCustomKeyStoreRequest = exports.DisableKeyRotationRequest = exports.DisableKeyRequest = exports.DescribeKeyResponse = exports.DescribeKeyRequest = exports.InvalidMarkerException = exports.DescribeCustomKeyStoresResponse = exports.DescribeCustomKeyStoresRequest = exports.DeleteImportedKeyMaterialRequest = exports.DeleteCustomKeyStoreResponse = exports.DeleteCustomKeyStoreRequest = exports.DeleteAliasRequest = exports.KeyUnavailableException = exports.InvalidKeyUsageException = exports.InvalidCiphertextException = exports.IncorrectKeyException = exports.DecryptResponse = exports.DecryptRequest = exports.DataKeySpec = exports.DataKeyPairSpec = exports.CustomKeyStoresListEntry = exports.CustomKeyStoreHasCMKsException = exports.UnsupportedOperationException = exports.TagException = exports.MalformedPolicyDocumentException = void 0;
5
- exports.VerifyResponse = exports.VerifyRequest = exports.UpdatePrimaryRegionRequest = exports.UpdateKeyDescriptionRequest = exports.UpdateCustomKeyStoreResponse = exports.UpdateCustomKeyStoreRequest = exports.UpdateAliasRequest = exports.UntagResourceRequest = exports.TagResourceRequest = exports.SignResponse = exports.SignRequest = exports.ScheduleKeyDeletionResponse = exports.ScheduleKeyDeletionRequest = exports.RevokeGrantRequest = exports.RetireGrantRequest = exports.ReplicateKeyResponse = exports.ReplicateKeyRequest = exports.ReEncryptResponse = exports.ReEncryptRequest = exports.PutKeyPolicyRequest = exports.MessageType = exports.ListRetirableGrantsRequest = exports.ListResourceTagsResponse = exports.ListResourceTagsRequest = exports.ListKeysResponse = exports.ListKeysRequest = exports.ListKeyPoliciesResponse = exports.ListKeyPoliciesRequest = exports.ListGrantsResponse = exports.ListGrantsRequest = exports.ListAliasesResponse = exports.ListAliasesRequest = exports.KMSInvalidSignatureException = exports.KeyListEntry = exports.InvalidGrantIdException = exports.InvalidImportTokenException = exports.IncorrectKeyMaterialException = exports.ImportKeyMaterialResponse = exports.ImportKeyMaterialRequest = exports.GrantListEntry = void 0;
3
+ exports.KeyMetadata = exports.SigningAlgorithmSpec = exports.MultiRegionConfiguration = exports.MultiRegionKey = exports.MultiRegionKeyType = exports.MacAlgorithmSpec = exports.KeyState = exports.KeyManagerType = exports.ExpirationModelType = exports.EncryptionAlgorithmSpec = exports.CreateKeyRequest = exports.Tag = exports.OriginType = exports.KeyUsageType = exports.KeySpec = exports.CustomerMasterKeySpec = exports.InvalidGrantTokenException = exports.DisabledException = exports.CreateGrantResponse = exports.CreateGrantRequest = exports.GrantOperation = exports.GrantConstraints = exports.IncorrectTrustAnchorException = exports.CustomKeyStoreNameInUseException = exports.CreateCustomKeyStoreResponse = exports.CreateCustomKeyStoreRequest = exports.LimitExceededException = exports.InvalidAliasNameException = exports.CreateAliasRequest = exports.ConnectionStateType = exports.ConnectionErrorCodeType = exports.CustomKeyStoreNotFoundException = exports.CustomKeyStoreInvalidStateException = exports.ConnectCustomKeyStoreResponse = exports.ConnectCustomKeyStoreRequest = exports.CloudHsmClusterNotRelatedException = exports.CloudHsmClusterNotFoundException = exports.CloudHsmClusterNotActiveException = exports.CloudHsmClusterInvalidConfigurationException = exports.CloudHsmClusterInUseException = exports.NotFoundException = exports.KMSInvalidStateException = exports.KMSInternalException = exports.InvalidArnException = exports.DependencyTimeoutException = exports.CancelKeyDeletionResponse = exports.CancelKeyDeletionRequest = exports.AlreadyExistsException = exports.AliasListEntry = exports.AlgorithmSpec = void 0;
4
+ exports.GetParametersForImportRequest = exports.WrappingKeySpec = exports.GetKeyRotationStatusResponse = exports.GetKeyRotationStatusRequest = exports.GetKeyPolicyResponse = exports.GetKeyPolicyRequest = exports.GenerateRandomResponse = exports.GenerateRandomRequest = exports.GenerateMacResponse = exports.GenerateMacRequest = exports.GenerateDataKeyWithoutPlaintextResponse = exports.GenerateDataKeyWithoutPlaintextRequest = exports.GenerateDataKeyPairWithoutPlaintextResponse = exports.GenerateDataKeyPairWithoutPlaintextRequest = exports.GenerateDataKeyPairResponse = exports.GenerateDataKeyPairRequest = exports.GenerateDataKeyResponse = exports.GenerateDataKeyRequest = exports.ExpiredImportTokenException = exports.EncryptResponse = exports.EncryptRequest = exports.EnableKeyRotationRequest = exports.EnableKeyRequest = exports.DisconnectCustomKeyStoreResponse = exports.DisconnectCustomKeyStoreRequest = exports.DisableKeyRotationRequest = exports.DisableKeyRequest = exports.DescribeKeyResponse = exports.DescribeKeyRequest = exports.InvalidMarkerException = exports.DescribeCustomKeyStoresResponse = exports.DescribeCustomKeyStoresRequest = exports.DeleteImportedKeyMaterialRequest = exports.DeleteCustomKeyStoreResponse = exports.DeleteCustomKeyStoreRequest = exports.DeleteAliasRequest = exports.KeyUnavailableException = exports.InvalidKeyUsageException = exports.InvalidCiphertextException = exports.IncorrectKeyException = exports.DecryptResponse = exports.DecryptRequest = exports.DataKeySpec = exports.DataKeyPairSpec = exports.CustomKeyStoresListEntry = exports.CustomKeyStoreHasCMKsException = exports.UnsupportedOperationException = exports.TagException = exports.MalformedPolicyDocumentException = exports.CreateKeyResponse = void 0;
5
+ exports.VerifyMacResponse = exports.VerifyMacRequest = exports.VerifyResponse = exports.VerifyRequest = exports.UpdatePrimaryRegionRequest = exports.UpdateKeyDescriptionRequest = exports.UpdateCustomKeyStoreResponse = exports.UpdateCustomKeyStoreRequest = exports.UpdateAliasRequest = exports.UntagResourceRequest = exports.TagResourceRequest = exports.SignResponse = exports.SignRequest = exports.ScheduleKeyDeletionResponse = exports.ScheduleKeyDeletionRequest = exports.RevokeGrantRequest = exports.RetireGrantRequest = exports.ReplicateKeyResponse = exports.ReplicateKeyRequest = exports.ReEncryptResponse = exports.ReEncryptRequest = exports.PutKeyPolicyRequest = exports.MessageType = exports.ListRetirableGrantsRequest = exports.ListResourceTagsResponse = exports.ListResourceTagsRequest = exports.ListKeysResponse = exports.ListKeysRequest = exports.ListKeyPoliciesResponse = exports.ListKeyPoliciesRequest = exports.ListGrantsResponse = exports.ListGrantsRequest = exports.ListAliasesResponse = exports.ListAliasesRequest = exports.KMSInvalidSignatureException = exports.KMSInvalidMacException = exports.KeyListEntry = exports.InvalidGrantIdException = exports.InvalidImportTokenException = exports.IncorrectKeyMaterialException = exports.ImportKeyMaterialResponse = exports.ImportKeyMaterialRequest = exports.GrantListEntry = exports.GetPublicKeyResponse = exports.GetPublicKeyRequest = exports.GetParametersForImportResponse = void 0;
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const KMSServiceException_1 = require("./KMSServiceException");
8
8
  var AlgorithmSpec;
@@ -317,12 +317,14 @@ var GrantOperation;
317
317
  GrantOperation["GenerateDataKeyPair"] = "GenerateDataKeyPair";
318
318
  GrantOperation["GenerateDataKeyPairWithoutPlaintext"] = "GenerateDataKeyPairWithoutPlaintext";
319
319
  GrantOperation["GenerateDataKeyWithoutPlaintext"] = "GenerateDataKeyWithoutPlaintext";
320
+ GrantOperation["GenerateMac"] = "GenerateMac";
320
321
  GrantOperation["GetPublicKey"] = "GetPublicKey";
321
322
  GrantOperation["ReEncryptFrom"] = "ReEncryptFrom";
322
323
  GrantOperation["ReEncryptTo"] = "ReEncryptTo";
323
324
  GrantOperation["RetireGrant"] = "RetireGrant";
324
325
  GrantOperation["Sign"] = "Sign";
325
326
  GrantOperation["Verify"] = "Verify";
327
+ GrantOperation["VerifyMac"] = "VerifyMac";
326
328
  })(GrantOperation = exports.GrantOperation || (exports.GrantOperation = {}));
327
329
  var CreateGrantRequest;
328
330
  (function (CreateGrantRequest) {
@@ -368,6 +370,10 @@ var CustomerMasterKeySpec;
368
370
  CustomerMasterKeySpec["ECC_NIST_P384"] = "ECC_NIST_P384";
369
371
  CustomerMasterKeySpec["ECC_NIST_P521"] = "ECC_NIST_P521";
370
372
  CustomerMasterKeySpec["ECC_SECG_P256K1"] = "ECC_SECG_P256K1";
373
+ CustomerMasterKeySpec["HMAC_224"] = "HMAC_224";
374
+ CustomerMasterKeySpec["HMAC_256"] = "HMAC_256";
375
+ CustomerMasterKeySpec["HMAC_384"] = "HMAC_384";
376
+ CustomerMasterKeySpec["HMAC_512"] = "HMAC_512";
371
377
  CustomerMasterKeySpec["RSA_2048"] = "RSA_2048";
372
378
  CustomerMasterKeySpec["RSA_3072"] = "RSA_3072";
373
379
  CustomerMasterKeySpec["RSA_4096"] = "RSA_4096";
@@ -379,6 +385,10 @@ var KeySpec;
379
385
  KeySpec["ECC_NIST_P384"] = "ECC_NIST_P384";
380
386
  KeySpec["ECC_NIST_P521"] = "ECC_NIST_P521";
381
387
  KeySpec["ECC_SECG_P256K1"] = "ECC_SECG_P256K1";
388
+ KeySpec["HMAC_224"] = "HMAC_224";
389
+ KeySpec["HMAC_256"] = "HMAC_256";
390
+ KeySpec["HMAC_384"] = "HMAC_384";
391
+ KeySpec["HMAC_512"] = "HMAC_512";
382
392
  KeySpec["RSA_2048"] = "RSA_2048";
383
393
  KeySpec["RSA_3072"] = "RSA_3072";
384
394
  KeySpec["RSA_4096"] = "RSA_4096";
@@ -387,6 +397,7 @@ var KeySpec;
387
397
  var KeyUsageType;
388
398
  (function (KeyUsageType) {
389
399
  KeyUsageType["ENCRYPT_DECRYPT"] = "ENCRYPT_DECRYPT";
400
+ KeyUsageType["GENERATE_VERIFY_MAC"] = "GENERATE_VERIFY_MAC";
390
401
  KeyUsageType["SIGN_VERIFY"] = "SIGN_VERIFY";
391
402
  })(KeyUsageType = exports.KeyUsageType || (exports.KeyUsageType = {}));
392
403
  var OriginType;
@@ -434,6 +445,13 @@ var KeyState;
434
445
  KeyState["Unavailable"] = "Unavailable";
435
446
  KeyState["Updating"] = "Updating";
436
447
  })(KeyState = exports.KeyState || (exports.KeyState = {}));
448
+ var MacAlgorithmSpec;
449
+ (function (MacAlgorithmSpec) {
450
+ MacAlgorithmSpec["HMAC_SHA_224"] = "HMAC_SHA_224";
451
+ MacAlgorithmSpec["HMAC_SHA_256"] = "HMAC_SHA_256";
452
+ MacAlgorithmSpec["HMAC_SHA_384"] = "HMAC_SHA_384";
453
+ MacAlgorithmSpec["HMAC_SHA_512"] = "HMAC_SHA_512";
454
+ })(MacAlgorithmSpec = exports.MacAlgorithmSpec || (exports.MacAlgorithmSpec = {}));
437
455
  var MultiRegionKeyType;
438
456
  (function (MultiRegionKeyType) {
439
457
  MultiRegionKeyType["PRIMARY"] = "PRIMARY";
@@ -786,6 +804,19 @@ var GenerateDataKeyWithoutPlaintextResponse;
786
804
  ...obj,
787
805
  });
788
806
  })(GenerateDataKeyWithoutPlaintextResponse = exports.GenerateDataKeyWithoutPlaintextResponse || (exports.GenerateDataKeyWithoutPlaintextResponse = {}));
807
+ var GenerateMacRequest;
808
+ (function (GenerateMacRequest) {
809
+ GenerateMacRequest.filterSensitiveLog = (obj) => ({
810
+ ...obj,
811
+ ...(obj.Message && { Message: smithy_client_1.SENSITIVE_STRING }),
812
+ });
813
+ })(GenerateMacRequest = exports.GenerateMacRequest || (exports.GenerateMacRequest = {}));
814
+ var GenerateMacResponse;
815
+ (function (GenerateMacResponse) {
816
+ GenerateMacResponse.filterSensitiveLog = (obj) => ({
817
+ ...obj,
818
+ });
819
+ })(GenerateMacResponse = exports.GenerateMacResponse || (exports.GenerateMacResponse = {}));
789
820
  var GenerateRandomRequest;
790
821
  (function (GenerateRandomRequest) {
791
822
  GenerateRandomRequest.filterSensitiveLog = (obj) => ({
@@ -915,6 +946,19 @@ var KeyListEntry;
915
946
  ...obj,
916
947
  });
917
948
  })(KeyListEntry = exports.KeyListEntry || (exports.KeyListEntry = {}));
949
+ class KMSInvalidMacException extends KMSServiceException_1.KMSServiceException {
950
+ constructor(opts) {
951
+ super({
952
+ name: "KMSInvalidMacException",
953
+ $fault: "client",
954
+ ...opts,
955
+ });
956
+ this.name = "KMSInvalidMacException";
957
+ this.$fault = "client";
958
+ Object.setPrototypeOf(this, KMSInvalidMacException.prototype);
959
+ }
960
+ }
961
+ exports.KMSInvalidMacException = KMSInvalidMacException;
918
962
  class KMSInvalidSignatureException extends KMSServiceException_1.KMSServiceException {
919
963
  constructor(opts) {
920
964
  super({
@@ -1122,3 +1166,16 @@ var VerifyResponse;
1122
1166
  ...obj,
1123
1167
  });
1124
1168
  })(VerifyResponse = exports.VerifyResponse || (exports.VerifyResponse = {}));
1169
+ var VerifyMacRequest;
1170
+ (function (VerifyMacRequest) {
1171
+ VerifyMacRequest.filterSensitiveLog = (obj) => ({
1172
+ ...obj,
1173
+ ...(obj.Message && { Message: smithy_client_1.SENSITIVE_STRING }),
1174
+ });
1175
+ })(VerifyMacRequest = exports.VerifyMacRequest || (exports.VerifyMacRequest = {}));
1176
+ var VerifyMacResponse;
1177
+ (function (VerifyMacResponse) {
1178
+ VerifyMacResponse.filterSensitiveLog = (obj) => ({
1179
+ ...obj,
1180
+ });
1181
+ })(VerifyMacResponse = exports.VerifyMacResponse || (exports.VerifyMacResponse = {}));
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializeAws_json1_1ConnectCustomKeyStoreCommand = exports.deserializeAws_json1_1CancelKeyDeletionCommand = exports.serializeAws_json1_1VerifyCommand = exports.serializeAws_json1_1UpdatePrimaryRegionCommand = exports.serializeAws_json1_1UpdateKeyDescriptionCommand = exports.serializeAws_json1_1UpdateCustomKeyStoreCommand = exports.serializeAws_json1_1UpdateAliasCommand = exports.serializeAws_json1_1UntagResourceCommand = exports.serializeAws_json1_1TagResourceCommand = exports.serializeAws_json1_1SignCommand = exports.serializeAws_json1_1ScheduleKeyDeletionCommand = exports.serializeAws_json1_1RevokeGrantCommand = exports.serializeAws_json1_1RetireGrantCommand = exports.serializeAws_json1_1ReplicateKeyCommand = exports.serializeAws_json1_1ReEncryptCommand = exports.serializeAws_json1_1PutKeyPolicyCommand = exports.serializeAws_json1_1ListRetirableGrantsCommand = exports.serializeAws_json1_1ListResourceTagsCommand = exports.serializeAws_json1_1ListKeysCommand = exports.serializeAws_json1_1ListKeyPoliciesCommand = exports.serializeAws_json1_1ListGrantsCommand = exports.serializeAws_json1_1ListAliasesCommand = exports.serializeAws_json1_1ImportKeyMaterialCommand = exports.serializeAws_json1_1GetPublicKeyCommand = exports.serializeAws_json1_1GetParametersForImportCommand = exports.serializeAws_json1_1GetKeyRotationStatusCommand = exports.serializeAws_json1_1GetKeyPolicyCommand = exports.serializeAws_json1_1GenerateRandomCommand = exports.serializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = exports.serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand = exports.serializeAws_json1_1GenerateDataKeyPairCommand = exports.serializeAws_json1_1GenerateDataKeyCommand = exports.serializeAws_json1_1EncryptCommand = exports.serializeAws_json1_1EnableKeyRotationCommand = exports.serializeAws_json1_1EnableKeyCommand = exports.serializeAws_json1_1DisconnectCustomKeyStoreCommand = exports.serializeAws_json1_1DisableKeyRotationCommand = exports.serializeAws_json1_1DisableKeyCommand = exports.serializeAws_json1_1DescribeKeyCommand = exports.serializeAws_json1_1DescribeCustomKeyStoresCommand = exports.serializeAws_json1_1DeleteImportedKeyMaterialCommand = exports.serializeAws_json1_1DeleteCustomKeyStoreCommand = exports.serializeAws_json1_1DeleteAliasCommand = exports.serializeAws_json1_1DecryptCommand = exports.serializeAws_json1_1CreateKeyCommand = exports.serializeAws_json1_1CreateGrantCommand = exports.serializeAws_json1_1CreateCustomKeyStoreCommand = exports.serializeAws_json1_1CreateAliasCommand = exports.serializeAws_json1_1ConnectCustomKeyStoreCommand = exports.serializeAws_json1_1CancelKeyDeletionCommand = void 0;
4
- exports.deserializeAws_json1_1VerifyCommand = exports.deserializeAws_json1_1UpdatePrimaryRegionCommand = exports.deserializeAws_json1_1UpdateKeyDescriptionCommand = exports.deserializeAws_json1_1UpdateCustomKeyStoreCommand = exports.deserializeAws_json1_1UpdateAliasCommand = exports.deserializeAws_json1_1UntagResourceCommand = exports.deserializeAws_json1_1TagResourceCommand = exports.deserializeAws_json1_1SignCommand = exports.deserializeAws_json1_1ScheduleKeyDeletionCommand = exports.deserializeAws_json1_1RevokeGrantCommand = exports.deserializeAws_json1_1RetireGrantCommand = exports.deserializeAws_json1_1ReplicateKeyCommand = exports.deserializeAws_json1_1ReEncryptCommand = exports.deserializeAws_json1_1PutKeyPolicyCommand = exports.deserializeAws_json1_1ListRetirableGrantsCommand = exports.deserializeAws_json1_1ListResourceTagsCommand = exports.deserializeAws_json1_1ListKeysCommand = exports.deserializeAws_json1_1ListKeyPoliciesCommand = exports.deserializeAws_json1_1ListGrantsCommand = exports.deserializeAws_json1_1ListAliasesCommand = exports.deserializeAws_json1_1ImportKeyMaterialCommand = exports.deserializeAws_json1_1GetPublicKeyCommand = exports.deserializeAws_json1_1GetParametersForImportCommand = exports.deserializeAws_json1_1GetKeyRotationStatusCommand = exports.deserializeAws_json1_1GetKeyPolicyCommand = exports.deserializeAws_json1_1GenerateRandomCommand = exports.deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = exports.deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand = exports.deserializeAws_json1_1GenerateDataKeyPairCommand = exports.deserializeAws_json1_1GenerateDataKeyCommand = exports.deserializeAws_json1_1EncryptCommand = exports.deserializeAws_json1_1EnableKeyRotationCommand = exports.deserializeAws_json1_1EnableKeyCommand = exports.deserializeAws_json1_1DisconnectCustomKeyStoreCommand = exports.deserializeAws_json1_1DisableKeyRotationCommand = exports.deserializeAws_json1_1DisableKeyCommand = exports.deserializeAws_json1_1DescribeKeyCommand = exports.deserializeAws_json1_1DescribeCustomKeyStoresCommand = exports.deserializeAws_json1_1DeleteImportedKeyMaterialCommand = exports.deserializeAws_json1_1DeleteCustomKeyStoreCommand = exports.deserializeAws_json1_1DeleteAliasCommand = exports.deserializeAws_json1_1DecryptCommand = exports.deserializeAws_json1_1CreateKeyCommand = exports.deserializeAws_json1_1CreateGrantCommand = exports.deserializeAws_json1_1CreateCustomKeyStoreCommand = exports.deserializeAws_json1_1CreateAliasCommand = void 0;
3
+ exports.serializeAws_json1_1VerifyMacCommand = exports.serializeAws_json1_1VerifyCommand = exports.serializeAws_json1_1UpdatePrimaryRegionCommand = exports.serializeAws_json1_1UpdateKeyDescriptionCommand = exports.serializeAws_json1_1UpdateCustomKeyStoreCommand = exports.serializeAws_json1_1UpdateAliasCommand = exports.serializeAws_json1_1UntagResourceCommand = exports.serializeAws_json1_1TagResourceCommand = exports.serializeAws_json1_1SignCommand = exports.serializeAws_json1_1ScheduleKeyDeletionCommand = exports.serializeAws_json1_1RevokeGrantCommand = exports.serializeAws_json1_1RetireGrantCommand = exports.serializeAws_json1_1ReplicateKeyCommand = exports.serializeAws_json1_1ReEncryptCommand = exports.serializeAws_json1_1PutKeyPolicyCommand = exports.serializeAws_json1_1ListRetirableGrantsCommand = exports.serializeAws_json1_1ListResourceTagsCommand = exports.serializeAws_json1_1ListKeysCommand = exports.serializeAws_json1_1ListKeyPoliciesCommand = exports.serializeAws_json1_1ListGrantsCommand = exports.serializeAws_json1_1ListAliasesCommand = exports.serializeAws_json1_1ImportKeyMaterialCommand = exports.serializeAws_json1_1GetPublicKeyCommand = exports.serializeAws_json1_1GetParametersForImportCommand = exports.serializeAws_json1_1GetKeyRotationStatusCommand = exports.serializeAws_json1_1GetKeyPolicyCommand = exports.serializeAws_json1_1GenerateRandomCommand = exports.serializeAws_json1_1GenerateMacCommand = exports.serializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = exports.serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand = exports.serializeAws_json1_1GenerateDataKeyPairCommand = exports.serializeAws_json1_1GenerateDataKeyCommand = exports.serializeAws_json1_1EncryptCommand = exports.serializeAws_json1_1EnableKeyRotationCommand = exports.serializeAws_json1_1EnableKeyCommand = exports.serializeAws_json1_1DisconnectCustomKeyStoreCommand = exports.serializeAws_json1_1DisableKeyRotationCommand = exports.serializeAws_json1_1DisableKeyCommand = exports.serializeAws_json1_1DescribeKeyCommand = exports.serializeAws_json1_1DescribeCustomKeyStoresCommand = exports.serializeAws_json1_1DeleteImportedKeyMaterialCommand = exports.serializeAws_json1_1DeleteCustomKeyStoreCommand = exports.serializeAws_json1_1DeleteAliasCommand = exports.serializeAws_json1_1DecryptCommand = exports.serializeAws_json1_1CreateKeyCommand = exports.serializeAws_json1_1CreateGrantCommand = exports.serializeAws_json1_1CreateCustomKeyStoreCommand = exports.serializeAws_json1_1CreateAliasCommand = exports.serializeAws_json1_1ConnectCustomKeyStoreCommand = exports.serializeAws_json1_1CancelKeyDeletionCommand = void 0;
4
+ exports.deserializeAws_json1_1VerifyMacCommand = exports.deserializeAws_json1_1VerifyCommand = exports.deserializeAws_json1_1UpdatePrimaryRegionCommand = exports.deserializeAws_json1_1UpdateKeyDescriptionCommand = exports.deserializeAws_json1_1UpdateCustomKeyStoreCommand = exports.deserializeAws_json1_1UpdateAliasCommand = exports.deserializeAws_json1_1UntagResourceCommand = exports.deserializeAws_json1_1TagResourceCommand = exports.deserializeAws_json1_1SignCommand = exports.deserializeAws_json1_1ScheduleKeyDeletionCommand = exports.deserializeAws_json1_1RevokeGrantCommand = exports.deserializeAws_json1_1RetireGrantCommand = exports.deserializeAws_json1_1ReplicateKeyCommand = exports.deserializeAws_json1_1ReEncryptCommand = exports.deserializeAws_json1_1PutKeyPolicyCommand = exports.deserializeAws_json1_1ListRetirableGrantsCommand = exports.deserializeAws_json1_1ListResourceTagsCommand = exports.deserializeAws_json1_1ListKeysCommand = exports.deserializeAws_json1_1ListKeyPoliciesCommand = exports.deserializeAws_json1_1ListGrantsCommand = exports.deserializeAws_json1_1ListAliasesCommand = exports.deserializeAws_json1_1ImportKeyMaterialCommand = exports.deserializeAws_json1_1GetPublicKeyCommand = exports.deserializeAws_json1_1GetParametersForImportCommand = exports.deserializeAws_json1_1GetKeyRotationStatusCommand = exports.deserializeAws_json1_1GetKeyPolicyCommand = exports.deserializeAws_json1_1GenerateRandomCommand = exports.deserializeAws_json1_1GenerateMacCommand = exports.deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = exports.deserializeAws_json1_1GenerateDataKeyPairWithoutPlaintextCommand = exports.deserializeAws_json1_1GenerateDataKeyPairCommand = exports.deserializeAws_json1_1GenerateDataKeyCommand = exports.deserializeAws_json1_1EncryptCommand = exports.deserializeAws_json1_1EnableKeyRotationCommand = exports.deserializeAws_json1_1EnableKeyCommand = exports.deserializeAws_json1_1DisconnectCustomKeyStoreCommand = exports.deserializeAws_json1_1DisableKeyRotationCommand = exports.deserializeAws_json1_1DisableKeyCommand = exports.deserializeAws_json1_1DescribeKeyCommand = exports.deserializeAws_json1_1DescribeCustomKeyStoresCommand = exports.deserializeAws_json1_1DeleteImportedKeyMaterialCommand = exports.deserializeAws_json1_1DeleteCustomKeyStoreCommand = exports.deserializeAws_json1_1DeleteAliasCommand = exports.deserializeAws_json1_1DecryptCommand = exports.deserializeAws_json1_1CreateKeyCommand = exports.deserializeAws_json1_1CreateGrantCommand = exports.deserializeAws_json1_1CreateCustomKeyStoreCommand = exports.deserializeAws_json1_1CreateAliasCommand = exports.deserializeAws_json1_1ConnectCustomKeyStoreCommand = exports.deserializeAws_json1_1CancelKeyDeletionCommand = void 0;
5
5
  const protocol_http_1 = require("@aws-sdk/protocol-http");
6
6
  const smithy_client_1 = require("@aws-sdk/smithy-client");
7
7
  const KMSServiceException_1 = require("../models/KMSServiceException");
@@ -226,6 +226,16 @@ const serializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = async (input,
226
226
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
227
227
  };
228
228
  exports.serializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand = serializeAws_json1_1GenerateDataKeyWithoutPlaintextCommand;
229
+ const serializeAws_json1_1GenerateMacCommand = async (input, context) => {
230
+ const headers = {
231
+ "content-type": "application/x-amz-json-1.1",
232
+ "x-amz-target": "TrentService.GenerateMac",
233
+ };
234
+ let body;
235
+ body = JSON.stringify(serializeAws_json1_1GenerateMacRequest(input, context));
236
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
237
+ };
238
+ exports.serializeAws_json1_1GenerateMacCommand = serializeAws_json1_1GenerateMacCommand;
229
239
  const serializeAws_json1_1GenerateRandomCommand = async (input, context) => {
230
240
  const headers = {
231
241
  "content-type": "application/x-amz-json-1.1",
@@ -486,6 +496,16 @@ const serializeAws_json1_1VerifyCommand = async (input, context) => {
486
496
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
487
497
  };
488
498
  exports.serializeAws_json1_1VerifyCommand = serializeAws_json1_1VerifyCommand;
499
+ const serializeAws_json1_1VerifyMacCommand = async (input, context) => {
500
+ const headers = {
501
+ "content-type": "application/x-amz-json-1.1",
502
+ "x-amz-target": "TrentService.VerifyMac",
503
+ };
504
+ let body;
505
+ body = JSON.stringify(serializeAws_json1_1VerifyMacRequest(input, context));
506
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
507
+ };
508
+ exports.serializeAws_json1_1VerifyMacCommand = serializeAws_json1_1VerifyMacCommand;
489
509
  const deserializeAws_json1_1CancelKeyDeletionCommand = async (output, context) => {
490
510
  if (output.statusCode >= 300) {
491
511
  return deserializeAws_json1_1CancelKeyDeletionCommandError(output, context);
@@ -1620,6 +1640,60 @@ const deserializeAws_json1_1GenerateDataKeyWithoutPlaintextCommandError = async
1620
1640
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1621
1641
  }
1622
1642
  };
1643
+ const deserializeAws_json1_1GenerateMacCommand = async (output, context) => {
1644
+ if (output.statusCode >= 300) {
1645
+ return deserializeAws_json1_1GenerateMacCommandError(output, context);
1646
+ }
1647
+ const data = await parseBody(output.body, context);
1648
+ let contents = {};
1649
+ contents = deserializeAws_json1_1GenerateMacResponse(data, context);
1650
+ const response = {
1651
+ $metadata: deserializeMetadata(output),
1652
+ ...contents,
1653
+ };
1654
+ return Promise.resolve(response);
1655
+ };
1656
+ exports.deserializeAws_json1_1GenerateMacCommand = deserializeAws_json1_1GenerateMacCommand;
1657
+ const deserializeAws_json1_1GenerateMacCommandError = async (output, context) => {
1658
+ const parsedOutput = {
1659
+ ...output,
1660
+ body: await parseBody(output.body, context),
1661
+ };
1662
+ let response;
1663
+ let errorCode = "UnknownError";
1664
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1665
+ switch (errorCode) {
1666
+ case "DisabledException":
1667
+ case "com.amazonaws.kms#DisabledException":
1668
+ throw await deserializeAws_json1_1DisabledExceptionResponse(parsedOutput, context);
1669
+ case "InvalidGrantTokenException":
1670
+ case "com.amazonaws.kms#InvalidGrantTokenException":
1671
+ throw await deserializeAws_json1_1InvalidGrantTokenExceptionResponse(parsedOutput, context);
1672
+ case "InvalidKeyUsageException":
1673
+ case "com.amazonaws.kms#InvalidKeyUsageException":
1674
+ throw await deserializeAws_json1_1InvalidKeyUsageExceptionResponse(parsedOutput, context);
1675
+ case "KeyUnavailableException":
1676
+ case "com.amazonaws.kms#KeyUnavailableException":
1677
+ throw await deserializeAws_json1_1KeyUnavailableExceptionResponse(parsedOutput, context);
1678
+ case "KMSInternalException":
1679
+ case "com.amazonaws.kms#KMSInternalException":
1680
+ throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
1681
+ case "KMSInvalidStateException":
1682
+ case "com.amazonaws.kms#KMSInvalidStateException":
1683
+ throw await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context);
1684
+ case "NotFoundException":
1685
+ case "com.amazonaws.kms#NotFoundException":
1686
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
1687
+ default:
1688
+ const parsedBody = parsedOutput.body;
1689
+ response = new KMSServiceException_1.KMSServiceException({
1690
+ name: parsedBody.code || parsedBody.Code || errorCode,
1691
+ $fault: "client",
1692
+ $metadata: deserializeMetadata(output),
1693
+ });
1694
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1695
+ }
1696
+ };
1623
1697
  const deserializeAws_json1_1GenerateRandomCommand = async (output, context) => {
1624
1698
  if (output.statusCode >= 300) {
1625
1699
  return deserializeAws_json1_1GenerateRandomCommandError(output, context);
@@ -2958,6 +3032,63 @@ const deserializeAws_json1_1VerifyCommandError = async (output, context) => {
2958
3032
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2959
3033
  }
2960
3034
  };
3035
+ const deserializeAws_json1_1VerifyMacCommand = async (output, context) => {
3036
+ if (output.statusCode >= 300) {
3037
+ return deserializeAws_json1_1VerifyMacCommandError(output, context);
3038
+ }
3039
+ const data = await parseBody(output.body, context);
3040
+ let contents = {};
3041
+ contents = deserializeAws_json1_1VerifyMacResponse(data, context);
3042
+ const response = {
3043
+ $metadata: deserializeMetadata(output),
3044
+ ...contents,
3045
+ };
3046
+ return Promise.resolve(response);
3047
+ };
3048
+ exports.deserializeAws_json1_1VerifyMacCommand = deserializeAws_json1_1VerifyMacCommand;
3049
+ const deserializeAws_json1_1VerifyMacCommandError = async (output, context) => {
3050
+ const parsedOutput = {
3051
+ ...output,
3052
+ body: await parseBody(output.body, context),
3053
+ };
3054
+ let response;
3055
+ let errorCode = "UnknownError";
3056
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
3057
+ switch (errorCode) {
3058
+ case "DisabledException":
3059
+ case "com.amazonaws.kms#DisabledException":
3060
+ throw await deserializeAws_json1_1DisabledExceptionResponse(parsedOutput, context);
3061
+ case "InvalidGrantTokenException":
3062
+ case "com.amazonaws.kms#InvalidGrantTokenException":
3063
+ throw await deserializeAws_json1_1InvalidGrantTokenExceptionResponse(parsedOutput, context);
3064
+ case "InvalidKeyUsageException":
3065
+ case "com.amazonaws.kms#InvalidKeyUsageException":
3066
+ throw await deserializeAws_json1_1InvalidKeyUsageExceptionResponse(parsedOutput, context);
3067
+ case "KeyUnavailableException":
3068
+ case "com.amazonaws.kms#KeyUnavailableException":
3069
+ throw await deserializeAws_json1_1KeyUnavailableExceptionResponse(parsedOutput, context);
3070
+ case "KMSInternalException":
3071
+ case "com.amazonaws.kms#KMSInternalException":
3072
+ throw await deserializeAws_json1_1KMSInternalExceptionResponse(parsedOutput, context);
3073
+ case "KMSInvalidMacException":
3074
+ case "com.amazonaws.kms#KMSInvalidMacException":
3075
+ throw await deserializeAws_json1_1KMSInvalidMacExceptionResponse(parsedOutput, context);
3076
+ case "KMSInvalidStateException":
3077
+ case "com.amazonaws.kms#KMSInvalidStateException":
3078
+ throw await deserializeAws_json1_1KMSInvalidStateExceptionResponse(parsedOutput, context);
3079
+ case "NotFoundException":
3080
+ case "com.amazonaws.kms#NotFoundException":
3081
+ throw await deserializeAws_json1_1NotFoundExceptionResponse(parsedOutput, context);
3082
+ default:
3083
+ const parsedBody = parsedOutput.body;
3084
+ response = new KMSServiceException_1.KMSServiceException({
3085
+ name: parsedBody.code || parsedBody.Code || errorCode,
3086
+ $fault: "client",
3087
+ $metadata: deserializeMetadata(output),
3088
+ });
3089
+ throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
3090
+ }
3091
+ };
2961
3092
  const deserializeAws_json1_1AlreadyExistsExceptionResponse = async (parsedOutput, context) => {
2962
3093
  const body = parsedOutput.body;
2963
3094
  const deserialized = deserializeAws_json1_1AlreadyExistsException(body, context);
@@ -3192,6 +3323,15 @@ const deserializeAws_json1_1KMSInternalExceptionResponse = async (parsedOutput,
3192
3323
  });
3193
3324
  return (0, smithy_client_1.decorateServiceException)(exception, body);
3194
3325
  };
3326
+ const deserializeAws_json1_1KMSInvalidMacExceptionResponse = async (parsedOutput, context) => {
3327
+ const body = parsedOutput.body;
3328
+ const deserialized = deserializeAws_json1_1KMSInvalidMacException(body, context);
3329
+ const exception = new models_0_1.KMSInvalidMacException({
3330
+ $metadata: deserializeMetadata(parsedOutput),
3331
+ ...deserialized,
3332
+ });
3333
+ return (0, smithy_client_1.decorateServiceException)(exception, body);
3334
+ };
3195
3335
  const deserializeAws_json1_1KMSInvalidSignatureExceptionResponse = async (parsedOutput, context) => {
3196
3336
  const body = parsedOutput.body;
3197
3337
  const deserialized = deserializeAws_json1_1KMSInvalidSignatureException(body, context);
@@ -3469,6 +3609,15 @@ const serializeAws_json1_1GenerateDataKeyWithoutPlaintextRequest = (input, conte
3469
3609
  ...(input.NumberOfBytes !== undefined && input.NumberOfBytes !== null && { NumberOfBytes: input.NumberOfBytes }),
3470
3610
  };
3471
3611
  };
3612
+ const serializeAws_json1_1GenerateMacRequest = (input, context) => {
3613
+ return {
3614
+ ...(input.GrantTokens !== undefined &&
3615
+ input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3616
+ ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3617
+ ...(input.MacAlgorithm !== undefined && input.MacAlgorithm !== null && { MacAlgorithm: input.MacAlgorithm }),
3618
+ ...(input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }),
3619
+ };
3620
+ };
3472
3621
  const serializeAws_json1_1GenerateRandomRequest = (input, context) => {
3473
3622
  return {
3474
3623
  ...(input.CustomKeyStoreId !== undefined &&
@@ -3744,6 +3893,16 @@ const serializeAws_json1_1UpdatePrimaryRegionRequest = (input, context) => {
3744
3893
  ...(input.PrimaryRegion !== undefined && input.PrimaryRegion !== null && { PrimaryRegion: input.PrimaryRegion }),
3745
3894
  };
3746
3895
  };
3896
+ const serializeAws_json1_1VerifyMacRequest = (input, context) => {
3897
+ return {
3898
+ ...(input.GrantTokens !== undefined &&
3899
+ input.GrantTokens !== null && { GrantTokens: serializeAws_json1_1GrantTokenList(input.GrantTokens, context) }),
3900
+ ...(input.KeyId !== undefined && input.KeyId !== null && { KeyId: input.KeyId }),
3901
+ ...(input.Mac !== undefined && input.Mac !== null && { Mac: context.base64Encoder(input.Mac) }),
3902
+ ...(input.MacAlgorithm !== undefined && input.MacAlgorithm !== null && { MacAlgorithm: input.MacAlgorithm }),
3903
+ ...(input.Message !== undefined && input.Message !== null && { Message: context.base64Encoder(input.Message) }),
3904
+ };
3905
+ };
3747
3906
  const serializeAws_json1_1VerifyRequest = (input, context) => {
3748
3907
  return {
3749
3908
  ...(input.GrantTokens !== undefined &&
@@ -3996,6 +4155,13 @@ const deserializeAws_json1_1GenerateDataKeyWithoutPlaintextResponse = (output, c
3996
4155
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),
3997
4156
  };
3998
4157
  };
4158
+ const deserializeAws_json1_1GenerateMacResponse = (output, context) => {
4159
+ return {
4160
+ KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4161
+ Mac: output.Mac !== undefined && output.Mac !== null ? context.base64Decoder(output.Mac) : undefined,
4162
+ MacAlgorithm: (0, smithy_client_1.expectString)(output.MacAlgorithm),
4163
+ };
4164
+ };
3999
4165
  const deserializeAws_json1_1GenerateRandomResponse = (output, context) => {
4000
4166
  return {
4001
4167
  Plaintext: output.Plaintext !== undefined && output.Plaintext !== null ? context.base64Decoder(output.Plaintext) : undefined,
@@ -4188,6 +4354,9 @@ const deserializeAws_json1_1KeyMetadata = (output, context) => {
4188
4354
  KeySpec: (0, smithy_client_1.expectString)(output.KeySpec),
4189
4355
  KeyState: (0, smithy_client_1.expectString)(output.KeyState),
4190
4356
  KeyUsage: (0, smithy_client_1.expectString)(output.KeyUsage),
4357
+ MacAlgorithms: output.MacAlgorithms !== undefined && output.MacAlgorithms !== null
4358
+ ? deserializeAws_json1_1MacAlgorithmSpecList(output.MacAlgorithms, context)
4359
+ : undefined,
4191
4360
  MultiRegion: (0, smithy_client_1.expectBoolean)(output.MultiRegion),
4192
4361
  MultiRegionConfiguration: output.MultiRegionConfiguration !== undefined && output.MultiRegionConfiguration !== null
4193
4362
  ? deserializeAws_json1_1MultiRegionConfiguration(output.MultiRegionConfiguration, context)
@@ -4212,6 +4381,11 @@ const deserializeAws_json1_1KMSInternalException = (output, context) => {
4212
4381
  message: (0, smithy_client_1.expectString)(output.message),
4213
4382
  };
4214
4383
  };
4384
+ const deserializeAws_json1_1KMSInvalidMacException = (output, context) => {
4385
+ return {
4386
+ message: (0, smithy_client_1.expectString)(output.message),
4387
+ };
4388
+ };
4215
4389
  const deserializeAws_json1_1KMSInvalidSignatureException = (output, context) => {
4216
4390
  return {
4217
4391
  message: (0, smithy_client_1.expectString)(output.message),
@@ -4272,6 +4446,17 @@ const deserializeAws_json1_1ListResourceTagsResponse = (output, context) => {
4272
4446
  Truncated: (0, smithy_client_1.expectBoolean)(output.Truncated),
4273
4447
  };
4274
4448
  };
4449
+ const deserializeAws_json1_1MacAlgorithmSpecList = (output, context) => {
4450
+ const retVal = (output || [])
4451
+ .filter((e) => e != null)
4452
+ .map((entry) => {
4453
+ if (entry === null) {
4454
+ return null;
4455
+ }
4456
+ return (0, smithy_client_1.expectString)(entry);
4457
+ });
4458
+ return retVal;
4459
+ };
4275
4460
  const deserializeAws_json1_1MalformedPolicyDocumentException = (output, context) => {
4276
4461
  return {
4277
4462
  message: (0, smithy_client_1.expectString)(output.message),
@@ -4401,6 +4586,13 @@ const deserializeAws_json1_1UnsupportedOperationException = (output, context) =>
4401
4586
  const deserializeAws_json1_1UpdateCustomKeyStoreResponse = (output, context) => {
4402
4587
  return {};
4403
4588
  };
4589
+ const deserializeAws_json1_1VerifyMacResponse = (output, context) => {
4590
+ return {
4591
+ KeyId: (0, smithy_client_1.expectString)(output.KeyId),
4592
+ MacAlgorithm: (0, smithy_client_1.expectString)(output.MacAlgorithm),
4593
+ MacValid: (0, smithy_client_1.expectBoolean)(output.MacValid),
4594
+ };
4595
+ };
4404
4596
  const deserializeAws_json1_1VerifyResponse = (output, context) => {
4405
4597
  return {
4406
4598
  KeyId: (0, smithy_client_1.expectString)(output.KeyId),