@aws-sdk/client-kms 3.36.0 → 3.39.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 (131) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist-cjs/KMS.js +0 -92
  3. package/dist-cjs/KMSClient.js +0 -97
  4. package/dist-cjs/commands/CancelKeyDeletionCommand.js +0 -37
  5. package/dist-cjs/commands/ConnectCustomKeyStoreCommand.js +0 -85
  6. package/dist-cjs/commands/CreateAliasCommand.js +0 -81
  7. package/dist-cjs/commands/CreateCustomKeyStoreCommand.js +0 -73
  8. package/dist-cjs/commands/CreateGrantCommand.js +0 -86
  9. package/dist-cjs/commands/CreateKeyCommand.js +0 -148
  10. package/dist-cjs/commands/DecryptCommand.js +0 -112
  11. package/dist-cjs/commands/DeleteAliasCommand.js +0 -71
  12. package/dist-cjs/commands/DeleteCustomKeyStoreCommand.js +0 -78
  13. package/dist-cjs/commands/DeleteImportedKeyMaterialCommand.js +0 -53
  14. package/dist-cjs/commands/DescribeCustomKeyStoresCommand.js +0 -77
  15. package/dist-cjs/commands/DescribeKeyCommand.js +0 -103
  16. package/dist-cjs/commands/DisableKeyCommand.js +0 -39
  17. package/dist-cjs/commands/DisableKeyRotationCommand.js +0 -49
  18. package/dist-cjs/commands/DisconnectCustomKeyStoreCommand.js +0 -76
  19. package/dist-cjs/commands/EnableKeyCommand.js +0 -36
  20. package/dist-cjs/commands/EnableKeyRotationCommand.js +0 -49
  21. package/dist-cjs/commands/EncryptCommand.js +0 -148
  22. package/dist-cjs/commands/GenerateDataKeyCommand.js +0 -121
  23. package/dist-cjs/commands/GenerateDataKeyPairCommand.js +0 -100
  24. package/dist-cjs/commands/GenerateDataKeyPairWithoutPlaintextCommand.js +0 -90
  25. package/dist-cjs/commands/GenerateDataKeyWithoutPlaintextCommand.js +0 -95
  26. package/dist-cjs/commands/GenerateRandomCommand.js +0 -33
  27. package/dist-cjs/commands/GetKeyPolicyCommand.js +0 -32
  28. package/dist-cjs/commands/GetKeyRotationStatusCommand.js +0 -61
  29. package/dist-cjs/commands/GetParametersForImportCommand.js +0 -58
  30. package/dist-cjs/commands/GetPublicKeyCommand.js +0 -70
  31. package/dist-cjs/commands/ImportKeyMaterialCommand.js +0 -87
  32. package/dist-cjs/commands/ListAliasesCommand.js +0 -66
  33. package/dist-cjs/commands/ListGrantsCommand.js +0 -69
  34. package/dist-cjs/commands/ListKeyPoliciesCommand.js +0 -46
  35. package/dist-cjs/commands/ListKeysCommand.js +0 -54
  36. package/dist-cjs/commands/ListResourceTagsCommand.js +0 -58
  37. package/dist-cjs/commands/ListRetirableGrantsCommand.js +0 -67
  38. package/dist-cjs/commands/PutKeyPolicyCommand.js +0 -37
  39. package/dist-cjs/commands/ReEncryptCommand.js +0 -122
  40. package/dist-cjs/commands/ReplicateKeyCommand.js +0 -101
  41. package/dist-cjs/commands/RetireGrantCommand.js +0 -70
  42. package/dist-cjs/commands/RevokeGrantCommand.js +0 -67
  43. package/dist-cjs/commands/ScheduleKeyDeletionCommand.js +0 -78
  44. package/dist-cjs/commands/SignCommand.js +0 -69
  45. package/dist-cjs/commands/TagResourceCommand.js +0 -71
  46. package/dist-cjs/commands/UntagResourceCommand.js +0 -67
  47. package/dist-cjs/commands/UpdateAliasCommand.js +0 -86
  48. package/dist-cjs/commands/UpdateCustomKeyStoreCommand.js +0 -96
  49. package/dist-cjs/commands/UpdateKeyDescriptionCommand.js +0 -47
  50. package/dist-cjs/commands/UpdatePrimaryRegionCommand.js +0 -89
  51. package/dist-cjs/commands/VerifyCommand.js +0 -54
  52. package/dist-cjs/commands/index.js +51 -0
  53. package/dist-cjs/endpoints.js +6 -1
  54. package/dist-cjs/index.js +4 -55
  55. package/dist-cjs/models/models_0.js +0 -366
  56. package/dist-cjs/pagination/ListAliasesPaginator.js +0 -10
  57. package/dist-cjs/pagination/ListGrantsPaginator.js +0 -10
  58. package/dist-cjs/pagination/ListKeyPoliciesPaginator.js +0 -10
  59. package/dist-cjs/pagination/ListKeysPaginator.js +0 -10
  60. package/dist-cjs/pagination/index.js +8 -0
  61. package/dist-cjs/protocols/Aws_json1_1.js +0 -5
  62. package/dist-cjs/runtimeConfig.browser.js +1 -5
  63. package/dist-cjs/runtimeConfig.js +1 -5
  64. package/dist-cjs/runtimeConfig.native.js +0 -3
  65. package/dist-cjs/runtimeConfig.shared.js +0 -3
  66. package/dist-es/commands/index.js +48 -0
  67. package/dist-es/endpoints.js +6 -1
  68. package/dist-es/index.js +4 -55
  69. package/dist-es/pagination/index.js +5 -0
  70. package/dist-types/commands/index.d.ts +48 -0
  71. package/dist-types/index.d.ts +4 -55
  72. package/dist-types/pagination/index.d.ts +5 -0
  73. package/dist-types/ts3.4/KMS.d.ts +49 -2646
  74. package/dist-types/ts3.4/KMSClient.d.ts +24 -178
  75. package/dist-types/ts3.4/commands/CancelKeyDeletionCommand.d.ts +2 -33
  76. package/dist-types/ts3.4/commands/ConnectCustomKeyStoreCommand.d.ts +2 -81
  77. package/dist-types/ts3.4/commands/CreateAliasCommand.d.ts +2 -77
  78. package/dist-types/ts3.4/commands/CreateCustomKeyStoreCommand.d.ts +2 -69
  79. package/dist-types/ts3.4/commands/CreateGrantCommand.d.ts +2 -82
  80. package/dist-types/ts3.4/commands/CreateKeyCommand.d.ts +2 -144
  81. package/dist-types/ts3.4/commands/DecryptCommand.d.ts +2 -108
  82. package/dist-types/ts3.4/commands/DeleteAliasCommand.d.ts +2 -67
  83. package/dist-types/ts3.4/commands/DeleteCustomKeyStoreCommand.d.ts +2 -74
  84. package/dist-types/ts3.4/commands/DeleteImportedKeyMaterialCommand.d.ts +2 -49
  85. package/dist-types/ts3.4/commands/DescribeCustomKeyStoresCommand.d.ts +2 -73
  86. package/dist-types/ts3.4/commands/DescribeKeyCommand.d.ts +2 -99
  87. package/dist-types/ts3.4/commands/DisableKeyCommand.d.ts +2 -35
  88. package/dist-types/ts3.4/commands/DisableKeyRotationCommand.d.ts +2 -45
  89. package/dist-types/ts3.4/commands/DisconnectCustomKeyStoreCommand.d.ts +2 -72
  90. package/dist-types/ts3.4/commands/EnableKeyCommand.d.ts +2 -32
  91. package/dist-types/ts3.4/commands/EnableKeyRotationCommand.d.ts +2 -45
  92. package/dist-types/ts3.4/commands/EncryptCommand.d.ts +2 -144
  93. package/dist-types/ts3.4/commands/GenerateDataKeyCommand.d.ts +2 -117
  94. package/dist-types/ts3.4/commands/GenerateDataKeyPairCommand.d.ts +2 -96
  95. package/dist-types/ts3.4/commands/GenerateDataKeyPairWithoutPlaintextCommand.d.ts +2 -86
  96. package/dist-types/ts3.4/commands/GenerateDataKeyWithoutPlaintextCommand.d.ts +2 -91
  97. package/dist-types/ts3.4/commands/GenerateRandomCommand.d.ts +2 -29
  98. package/dist-types/ts3.4/commands/GetKeyPolicyCommand.d.ts +2 -28
  99. package/dist-types/ts3.4/commands/GetKeyRotationStatusCommand.d.ts +2 -57
  100. package/dist-types/ts3.4/commands/GetParametersForImportCommand.d.ts +2 -54
  101. package/dist-types/ts3.4/commands/GetPublicKeyCommand.d.ts +2 -66
  102. package/dist-types/ts3.4/commands/ImportKeyMaterialCommand.d.ts +2 -83
  103. package/dist-types/ts3.4/commands/ListAliasesCommand.d.ts +2 -62
  104. package/dist-types/ts3.4/commands/ListGrantsCommand.d.ts +2 -65
  105. package/dist-types/ts3.4/commands/ListKeyPoliciesCommand.d.ts +2 -42
  106. package/dist-types/ts3.4/commands/ListKeysCommand.d.ts +2 -50
  107. package/dist-types/ts3.4/commands/ListResourceTagsCommand.d.ts +2 -54
  108. package/dist-types/ts3.4/commands/ListRetirableGrantsCommand.d.ts +2 -63
  109. package/dist-types/ts3.4/commands/PutKeyPolicyCommand.d.ts +2 -33
  110. package/dist-types/ts3.4/commands/ReEncryptCommand.d.ts +2 -118
  111. package/dist-types/ts3.4/commands/ReplicateKeyCommand.d.ts +2 -97
  112. package/dist-types/ts3.4/commands/RetireGrantCommand.d.ts +2 -66
  113. package/dist-types/ts3.4/commands/RevokeGrantCommand.d.ts +2 -63
  114. package/dist-types/ts3.4/commands/ScheduleKeyDeletionCommand.d.ts +2 -74
  115. package/dist-types/ts3.4/commands/SignCommand.d.ts +2 -65
  116. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +2 -67
  117. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +2 -63
  118. package/dist-types/ts3.4/commands/UpdateAliasCommand.d.ts +2 -82
  119. package/dist-types/ts3.4/commands/UpdateCustomKeyStoreCommand.d.ts +2 -92
  120. package/dist-types/ts3.4/commands/UpdateKeyDescriptionCommand.d.ts +2 -43
  121. package/dist-types/ts3.4/commands/UpdatePrimaryRegionCommand.d.ts +2 -85
  122. package/dist-types/ts3.4/commands/VerifyCommand.d.ts +2 -50
  123. package/dist-types/ts3.4/commands/index.d.ts +48 -0
  124. package/dist-types/ts3.4/index.d.ts +4 -55
  125. package/dist-types/ts3.4/models/models_0.d.ts +445 -2963
  126. package/dist-types/ts3.4/pagination/index.d.ts +5 -0
  127. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
  128. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
  129. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
  130. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
  131. package/package.json +32 -32
@@ -5,65 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
- /**
9
- * <p>Gets a list of all KMS keys in the caller's Amazon Web Services account and Region.</p>
10
- * <p>
11
- * <b>Cross-account use</b>: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.</p>
12
- *
13
- * <p>
14
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ListKeys</a> (IAM policy)</p>
15
- * <p>
16
- * <b>Related operations:</b>
17
- * </p>
18
- * <ul>
19
- * <li>
20
- * <p>
21
- * <a>CreateKey</a>
22
- * </p>
23
- * </li>
24
- * <li>
25
- * <p>
26
- * <a>DescribeKey</a>
27
- * </p>
28
- * </li>
29
- * <li>
30
- * <p>
31
- * <a>ListAliases</a>
32
- * </p>
33
- * </li>
34
- * <li>
35
- * <p>
36
- * <a>ListResourceTags</a>
37
- * </p>
38
- * </li>
39
- * </ul>
40
- * @example
41
- * Use a bare-bones client and the command you need to make an API call.
42
- * ```javascript
43
- * import { KMSClient, ListKeysCommand } from "@aws-sdk/client-kms"; // ES Modules import
44
- * // const { KMSClient, ListKeysCommand } = require("@aws-sdk/client-kms"); // CommonJS import
45
- * const client = new KMSClient(config);
46
- * const command = new ListKeysCommand(input);
47
- * const response = await client.send(command);
48
- * ```
49
- *
50
- * @see {@link ListKeysCommandInput} for command's `input` shape.
51
- * @see {@link ListKeysCommandOutput} for command's `response` shape.
52
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
53
- *
54
- */
55
8
  class ListKeysCommand extends smithy_client_1.Command {
56
- // Start section: command_properties
57
- // End section: command_properties
58
9
  constructor(input) {
59
- // Start section: command_constructor
60
10
  super();
61
11
  this.input = input;
62
- // End section: command_constructor
63
12
  }
64
- /**
65
- * @internal
66
- */
67
13
  resolveMiddleware(clientStack, configuration, options) {
68
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
69
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,69 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
- /**
9
- * <p>Returns all tags on the specified KMS key.</p>
10
- * <p>For general information about tags, including the format and syntax, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in
11
- * the <i>Amazon Web Services General Reference</i>. For information about using
12
- * tags in KMS, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html">Tagging
13
- * keys</a>.</p>
14
- * <p>
15
- * <b>Cross-account use</b>: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.</p>
16
- *
17
- * <p>
18
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ListResourceTags</a> (key policy)</p>
19
- * <p>
20
- * <b>Related operations:</b>
21
- * </p>
22
- * <ul>
23
- * <li>
24
- * <p>
25
- * <a>CreateKey</a>
26
- * </p>
27
- * </li>
28
- * <li>
29
- * <p>
30
- * <a>ReplicateKey</a>
31
- * </p>
32
- * </li>
33
- * <li>
34
- * <p>
35
- * <a>TagResource</a>
36
- * </p>
37
- * </li>
38
- * <li>
39
- * <p>
40
- * <a>UntagResource</a>
41
- * </p>
42
- * </li>
43
- * </ul>
44
- * @example
45
- * Use a bare-bones client and the command you need to make an API call.
46
- * ```javascript
47
- * import { KMSClient, ListResourceTagsCommand } from "@aws-sdk/client-kms"; // ES Modules import
48
- * // const { KMSClient, ListResourceTagsCommand } = require("@aws-sdk/client-kms"); // CommonJS import
49
- * const client = new KMSClient(config);
50
- * const command = new ListResourceTagsCommand(input);
51
- * const response = await client.send(command);
52
- * ```
53
- *
54
- * @see {@link ListResourceTagsCommandInput} for command's `input` shape.
55
- * @see {@link ListResourceTagsCommandOutput} for command's `response` shape.
56
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
57
- *
58
- */
59
8
  class ListResourceTagsCommand extends smithy_client_1.Command {
60
- // Start section: command_properties
61
- // End section: command_properties
62
9
  constructor(input) {
63
- // Start section: command_constructor
64
10
  super();
65
11
  this.input = input;
66
- // End section: command_constructor
67
12
  }
68
- /**
69
- * @internal
70
- */
71
13
  resolveMiddleware(clientStack, configuration, options) {
72
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
73
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,78 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
- /**
9
- * <p>Returns information about all grants in the Amazon Web Services account and Region that have the
10
- * specified retiring principal. </p>
11
- * <p>You can specify any principal in your Amazon Web Services account. The grants that are returned include
12
- * grants for KMS keys in your Amazon Web Services account and other Amazon Web Services accounts. You might use this
13
- * operation to determine which grants you may retire. To retire a grant, use the <a>RetireGrant</a> operation.</p>
14
- * <p>For detailed information about grants, including grant terminology, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html">Using grants</a> in the
15
- * <i>
16
- * <i>Key Management Service Developer Guide</i>
17
- * </i>. For examples of working with grants in several
18
- * programming languages, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html">Programming grants</a>. </p>
19
- * <p>
20
- * <b>Cross-account use</b>: You must specify a principal in your
21
- * Amazon Web Services account. However, this operation can return grants in any Amazon Web Services account. You do not need
22
- * <code>kms:ListRetirableGrants</code> permission (or any other additional permission) in any
23
- * Amazon Web Services account other than your own.</p>
24
- *
25
- * <p>
26
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ListRetirableGrants</a> (IAM policy) in your
27
- * Amazon Web Services account.</p>
28
- * <p>
29
- * <b>Related operations:</b>
30
- * </p>
31
- * <ul>
32
- * <li>
33
- * <p>
34
- * <a>CreateGrant</a>
35
- * </p>
36
- * </li>
37
- * <li>
38
- * <p>
39
- * <a>ListGrants</a>
40
- * </p>
41
- * </li>
42
- * <li>
43
- * <p>
44
- * <a>RetireGrant</a>
45
- * </p>
46
- * </li>
47
- * <li>
48
- * <p>
49
- * <a>RevokeGrant</a>
50
- * </p>
51
- * </li>
52
- * </ul>
53
- * @example
54
- * Use a bare-bones client and the command you need to make an API call.
55
- * ```javascript
56
- * import { KMSClient, ListRetirableGrantsCommand } from "@aws-sdk/client-kms"; // ES Modules import
57
- * // const { KMSClient, ListRetirableGrantsCommand } = require("@aws-sdk/client-kms"); // CommonJS import
58
- * const client = new KMSClient(config);
59
- * const command = new ListRetirableGrantsCommand(input);
60
- * const response = await client.send(command);
61
- * ```
62
- *
63
- * @see {@link ListRetirableGrantsCommandInput} for command's `input` shape.
64
- * @see {@link ListRetirableGrantsCommandOutput} for command's `response` shape.
65
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
66
- *
67
- */
68
8
  class ListRetirableGrantsCommand extends smithy_client_1.Command {
69
- // Start section: command_properties
70
- // End section: command_properties
71
9
  constructor(input) {
72
- // Start section: command_constructor
73
10
  super();
74
11
  this.input = input;
75
- // End section: command_constructor
76
12
  }
77
- /**
78
- * @internal
79
- */
80
13
  resolveMiddleware(clientStack, configuration, options) {
81
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
82
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,48 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
- /**
9
- * <p>Attaches a key policy to the specified KMS key. </p>
10
- * <p>For more information about key policies, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html">Key Policies</a> in the <i>Key Management Service Developer Guide</i>.
11
- * For help writing and formatting a JSON policy document, see the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html">IAM JSON Policy Reference</a> in the <i>
12
- * <i>Identity and Access Management User Guide</i>
13
- * </i>. For examples of adding a key policy in multiple programming languages,
14
- * see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-key-policies.html#put-policy">Setting a key policy</a> in the <i>Key Management Service Developer Guide</i>.</p>
15
- * <p>
16
- * <b>Cross-account use</b>: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.</p>
17
- *
18
- * <p>
19
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:PutKeyPolicy</a> (key policy)</p>
20
- * <p>
21
- * <b>Related operations</b>: <a>GetKeyPolicy</a>
22
- * </p>
23
- * @example
24
- * Use a bare-bones client and the command you need to make an API call.
25
- * ```javascript
26
- * import { KMSClient, PutKeyPolicyCommand } from "@aws-sdk/client-kms"; // ES Modules import
27
- * // const { KMSClient, PutKeyPolicyCommand } = require("@aws-sdk/client-kms"); // CommonJS import
28
- * const client = new KMSClient(config);
29
- * const command = new PutKeyPolicyCommand(input);
30
- * const response = await client.send(command);
31
- * ```
32
- *
33
- * @see {@link PutKeyPolicyCommandInput} for command's `input` shape.
34
- * @see {@link PutKeyPolicyCommandOutput} for command's `response` shape.
35
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
36
- *
37
- */
38
8
  class PutKeyPolicyCommand extends smithy_client_1.Command {
39
- // Start section: command_properties
40
- // End section: command_properties
41
9
  constructor(input) {
42
- // Start section: command_constructor
43
10
  super();
44
11
  this.input = input;
45
- // End section: command_constructor
46
12
  }
47
- /**
48
- * @internal
49
- */
50
13
  resolveMiddleware(clientStack, configuration, options) {
51
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
52
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,133 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
- /**
9
- * <p>Decrypts ciphertext and then reencrypts it entirely within KMS. You can use this
10
- * operation to change the KMS key under which data is encrypted, such as when you <a href="https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-manually">manually
11
- * rotate</a> a KMS key or change the KMS key that protects a ciphertext. You can also use
12
- * it to reencrypt ciphertext under the same KMS key, such as to change the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">encryption
13
- * context</a> of a ciphertext.</p>
14
- * <p>The <code>ReEncrypt</code> operation can decrypt ciphertext that was encrypted by using an
15
- * KMS KMS key in an KMS operation, such as <a>Encrypt</a> or <a>GenerateDataKey</a>. It can also decrypt ciphertext that was encrypted by using the
16
- * public key of an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks">asymmetric KMS key</a>
17
- * outside of KMS. However, it cannot decrypt ciphertext produced by other libraries, such as
18
- * the <a href="https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/">Amazon Web Services Encryption SDK</a> or
19
- * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html">Amazon S3
20
- * client-side encryption</a>. These libraries return a ciphertext format that is
21
- * incompatible with KMS.</p>
22
- * <p>When you use the <code>ReEncrypt</code> operation, you need to provide information for the
23
- * decrypt operation and the subsequent encrypt operation.</p>
24
- * <ul>
25
- * <li>
26
- * <p>If your ciphertext was encrypted under an asymmetric KMS key, you must use the
27
- * <code>SourceKeyId</code> parameter to identify the KMS key that encrypted the
28
- * ciphertext. You must also supply the encryption algorithm that was used. This information
29
- * is required to decrypt the data.</p>
30
- * </li>
31
- * <li>
32
- * <p>If your ciphertext was encrypted under a symmetric KMS key, the
33
- * <code>SourceKeyId</code> parameter is optional. KMS can get this information from
34
- * metadata that it adds to the symmetric ciphertext blob. This feature adds durability to
35
- * your implementation by ensuring that authorized users can decrypt ciphertext decades after
36
- * it was encrypted, even if they've lost track of the key ID. However, specifying the source
37
- * KMS key is always recommended as a best practice. When you use the
38
- * <code>SourceKeyId</code> parameter to specify a KMS key, KMS uses only the KMS key you
39
- * specify. If the ciphertext was encrypted under a different KMS key, the
40
- * <code>ReEncrypt</code> operation fails. This practice ensures that you use the KMS key
41
- * that you intend.</p>
42
- * </li>
43
- * <li>
44
- * <p>To reencrypt the data, you must use the <code>DestinationKeyId</code> parameter
45
- * specify the KMS key that re-encrypts the data after it is decrypted. You can select a
46
- * symmetric or asymmetric KMS key. If the destination KMS key is an asymmetric KMS key, you
47
- * must also provide the encryption algorithm. The algorithm that you choose must be
48
- * compatible with the KMS key.</p>
49
- *
50
- * <important>
51
- * <p>When you use an asymmetric KMS key to encrypt or reencrypt data, be sure to record the KMS key and encryption algorithm that you choose. You will be required to provide the same KMS key and encryption algorithm when you decrypt the data. If the KMS key and algorithm do not match the values used to encrypt the data, the decrypt operation fails.</p>
52
- * <p>You are not required to supply the key ID and encryption algorithm when you decrypt with symmetric KMS keys because KMS stores this information in the ciphertext blob. KMS cannot store metadata in ciphertext generated with asymmetric keys. The standard format for asymmetric key ciphertext does not include configurable fields.</p>
53
- * </important>
54
- * </li>
55
- * </ul>
56
- * <p>The KMS key that you use for this operation must be in a compatible key state. For
57
- * details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key state: Effect on your KMS key</a> in the <i>Key Management Service Developer Guide</i>.</p>
58
- * <p>
59
- * <b>Cross-account use</b>: Yes.
60
- * The source KMS key and destination KMS key can be in different Amazon Web Services accounts. Either or both
61
- * KMS keys can be in a different account than the caller. To specify a KMS key in a different
62
- * account, you must use its key ARN or alias ARN.</p>
63
- *
64
- * <p>
65
- * <b>Required permissions</b>:</p>
66
- * <ul>
67
- * <li>
68
- * <p>
69
- * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ReEncryptFrom</a>
70
- * permission on the source KMS key (key policy)</p>
71
- * </li>
72
- * <li>
73
- * <p>
74
- * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ReEncryptTo</a>
75
- * permission on the destination KMS key (key policy)</p>
76
- * </li>
77
- * </ul>
78
- * <p>To permit reencryption from or to a KMS key, include the <code>"kms:ReEncrypt*"</code>
79
- * permission in your <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html">key policy</a>. This permission is
80
- * automatically included in the key policy when you use the console to create a KMS key. But you
81
- * must include it manually when you create a KMS key programmatically or when you use the <a>PutKeyPolicy</a> operation to set a key policy.</p>
82
- *
83
- * <p>
84
- * <b>Related operations:</b>
85
- * </p>
86
- * <ul>
87
- * <li>
88
- * <p>
89
- * <a>Decrypt</a>
90
- * </p>
91
- * </li>
92
- * <li>
93
- * <p>
94
- * <a>Encrypt</a>
95
- * </p>
96
- * </li>
97
- * <li>
98
- * <p>
99
- * <a>GenerateDataKey</a>
100
- * </p>
101
- * </li>
102
- * <li>
103
- * <p>
104
- * <a>GenerateDataKeyPair</a>
105
- * </p>
106
- * </li>
107
- * </ul>
108
- * @example
109
- * Use a bare-bones client and the command you need to make an API call.
110
- * ```javascript
111
- * import { KMSClient, ReEncryptCommand } from "@aws-sdk/client-kms"; // ES Modules import
112
- * // const { KMSClient, ReEncryptCommand } = require("@aws-sdk/client-kms"); // CommonJS import
113
- * const client = new KMSClient(config);
114
- * const command = new ReEncryptCommand(input);
115
- * const response = await client.send(command);
116
- * ```
117
- *
118
- * @see {@link ReEncryptCommandInput} for command's `input` shape.
119
- * @see {@link ReEncryptCommandOutput} for command's `response` shape.
120
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
121
- *
122
- */
123
8
  class ReEncryptCommand extends smithy_client_1.Command {
124
- // Start section: command_properties
125
- // End section: command_properties
126
9
  constructor(input) {
127
- // Start section: command_constructor
128
10
  super();
129
11
  this.input = input;
130
- // End section: command_constructor
131
12
  }
132
- /**
133
- * @internal
134
- */
135
13
  resolveMiddleware(clientStack, configuration, options) {
136
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
137
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,112 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
- /**
9
- * <p>Replicates a multi-Region key into the specified Region. This operation creates a
10
- * multi-Region replica key based on a multi-Region primary key in a different Region of the same
11
- * Amazon Web Services partition. You can create multiple replicas of a primary key, but each must be in a
12
- * different Region. To create a multi-Region primary key, use the <a>CreateKey</a>
13
- * operation.</p>
14
- * <p>This operation supports <i>multi-Region keys</i>, an KMS feature that lets you create multiple
15
- * interoperable KMS keys in different Amazon Web Services Regions. Because these KMS keys have the same key ID, key
16
- * material, and other metadata, you can use them interchangeably to encrypt data in one Amazon Web Services Region and decrypt
17
- * it in a different Amazon Web Services Region without re-encrypting the data or making a cross-Region call. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
18
- * <p>A <i>replica key</i> is a fully-functional KMS key that can be used
19
- * independently of its primary and peer replica keys. A primary key and its replica keys share
20
- * properties that make them interoperable. They have the same <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id">key ID</a> and key material. They also
21
- * have the same <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-spec">key
22
- * spec</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-usage">key
23
- * usage</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin">key
24
- * material origin</a>, and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html">automatic key rotation status</a>. KMS automatically synchronizes these shared
25
- * properties among related multi-Region keys. All other properties of a replica key can differ,
26
- * including its <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html">key
27
- * policy</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html">tags</a>, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html">aliases</a>, and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">key
28
- * state</a>. KMS pricing and quotas for KMS keys apply to each primary key and replica
29
- * key.</p>
30
- * <p>When this operation completes, the new replica key has a transient key state of
31
- * <code>Creating</code>. This key state changes to <code>Enabled</code> (or
32
- * <code>PendingImport</code>) after a few seconds when the process of creating the new replica
33
- * key is complete. While the key state is <code>Creating</code>, you can manage key, but you
34
- * cannot yet use it in cryptographic operations. If you are creating and using the replica key
35
- * programmatically, retry on <code>KMSInvalidStateException</code> or call
36
- * <code>DescribeKey</code> to check its <code>KeyState</code> value before using it. For
37
- * details about the <code>Creating</code> key state, see <a href="kms/latest/developerguide/key-state.html">Key state: Effect on your KMS key</a> in the
38
- * <i>Key Management Service Developer Guide</i>.</p>
39
- * <p>The CloudTrail log of a <code>ReplicateKey</code> operation records a
40
- * <code>ReplicateKey</code> operation in the primary key's Region and a <a>CreateKey</a> operation in the replica key's Region.</p>
41
- * <p>If you replicate a multi-Region primary key with imported key material, the replica key is
42
- * created with no key material. You must import the same key material that you imported into the
43
- * primary key. For details, see <a href="kms/latest/developerguide/multi-region-keys-import.html">Importing key material into multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
44
- * <p>To convert a replica key to a primary key, use the <a>UpdatePrimaryRegion</a>
45
- * operation.</p>
46
- * <note>
47
- * <p>
48
- * <code>ReplicateKey</code> uses different default values for the <code>KeyPolicy</code>
49
- * and <code>Tags</code> parameters than those used in the KMS console. For details, see the
50
- * parameter descriptions.</p>
51
- * </note>
52
- * <p>
53
- * <b>Cross-account use</b>: No. You cannot use this operation to
54
- * create a replica key in a different Amazon Web Services account. </p>
55
- * <p>
56
- * <b>Required permissions</b>: </p>
57
- * <ul>
58
- * <li>
59
- * <p>
60
- * <code>kms:ReplicateKey</code> on the primary key (in the primary key's Region).
61
- * Include this permission in the primary key's key policy.</p>
62
- * </li>
63
- * <li>
64
- * <p>
65
- * <code>kms:CreateKey</code> in an IAM policy in the replica Region.</p>
66
- * </li>
67
- * <li>
68
- * <p>To use the <code>Tags</code> parameter, <code>kms:TagResource</code> in an IAM policy
69
- * in the replica Region.</p>
70
- * </li>
71
- * </ul>
72
- * <p>
73
- * <b>Related operations</b>
74
- * </p>
75
- * <ul>
76
- * <li>
77
- * <p>
78
- * <a>CreateKey</a>
79
- * </p>
80
- * </li>
81
- * <li>
82
- * <p>
83
- * <a>UpdatePrimaryRegion</a>
84
- * </p>
85
- * </li>
86
- * </ul>
87
- * @example
88
- * Use a bare-bones client and the command you need to make an API call.
89
- * ```javascript
90
- * import { KMSClient, ReplicateKeyCommand } from "@aws-sdk/client-kms"; // ES Modules import
91
- * // const { KMSClient, ReplicateKeyCommand } = require("@aws-sdk/client-kms"); // CommonJS import
92
- * const client = new KMSClient(config);
93
- * const command = new ReplicateKeyCommand(input);
94
- * const response = await client.send(command);
95
- * ```
96
- *
97
- * @see {@link ReplicateKeyCommandInput} for command's `input` shape.
98
- * @see {@link ReplicateKeyCommandOutput} for command's `response` shape.
99
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
100
- *
101
- */
102
8
  class ReplicateKeyCommand extends smithy_client_1.Command {
103
- // Start section: command_properties
104
- // End section: command_properties
105
9
  constructor(input) {
106
- // Start section: command_constructor
107
10
  super();
108
11
  this.input = input;
109
- // End section: command_constructor
110
12
  }
111
- /**
112
- * @internal
113
- */
114
13
  resolveMiddleware(clientStack, configuration, options) {
115
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
116
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,81 +5,11 @@ const middleware_serde_1 = require("@aws-sdk/middleware-serde");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
8
- /**
9
- * <p>Deletes a grant. Typically, you retire a grant when you no longer need its permissions. To
10
- * identify the grant to retire, use a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">grant token</a>, or both the grant ID and a
11
- * key identifier (key ID or key ARN) of the KMS key. The <a>CreateGrant</a> operation
12
- * returns both values.</p>
13
- * <p>This operation can be called by the <i>retiring principal</i> for a grant,
14
- * by the <i>grantee principal</i> if the grant allows the <code>RetireGrant</code>
15
- * operation, and by the Amazon Web Services account (root user) in which the grant is created. It can also be
16
- * called by principals to whom permission for retiring a grant is delegated. For details, see
17
- * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete">Retiring and
18
- * revoking grants</a> in the <i>Key Management Service Developer Guide</i>.</p>
19
- * <p>For detailed information about grants, including grant terminology, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html">Using grants</a> in the
20
- * <i>
21
- * <i>Key Management Service Developer Guide</i>
22
- * </i>. For examples of working with grants in several
23
- * programming languages, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html">Programming grants</a>. </p>
24
- * <p>
25
- * <b>Cross-account use</b>: Yes. You can retire a grant on a KMS
26
- * key in a different Amazon Web Services account.</p>
27
- * <p>
28
- * <b>Required permissions:</b>:Permission to retire a grant is
29
- * determined primarily by the grant. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete">Retiring and revoking grants</a> in
30
- * the <i>Key Management Service Developer Guide</i>.</p>
31
- * <p>
32
- * <b>Related operations:</b>
33
- * </p>
34
- * <ul>
35
- * <li>
36
- * <p>
37
- * <a>CreateGrant</a>
38
- * </p>
39
- * </li>
40
- * <li>
41
- * <p>
42
- * <a>ListGrants</a>
43
- * </p>
44
- * </li>
45
- * <li>
46
- * <p>
47
- * <a>ListRetirableGrants</a>
48
- * </p>
49
- * </li>
50
- * <li>
51
- * <p>
52
- * <a>RevokeGrant</a>
53
- * </p>
54
- * </li>
55
- * </ul>
56
- * @example
57
- * Use a bare-bones client and the command you need to make an API call.
58
- * ```javascript
59
- * import { KMSClient, RetireGrantCommand } from "@aws-sdk/client-kms"; // ES Modules import
60
- * // const { KMSClient, RetireGrantCommand } = require("@aws-sdk/client-kms"); // CommonJS import
61
- * const client = new KMSClient(config);
62
- * const command = new RetireGrantCommand(input);
63
- * const response = await client.send(command);
64
- * ```
65
- *
66
- * @see {@link RetireGrantCommandInput} for command's `input` shape.
67
- * @see {@link RetireGrantCommandOutput} for command's `response` shape.
68
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
69
- *
70
- */
71
8
  class RetireGrantCommand extends smithy_client_1.Command {
72
- // Start section: command_properties
73
- // End section: command_properties
74
9
  constructor(input) {
75
- // Start section: command_constructor
76
10
  super();
77
11
  this.input = input;
78
- // End section: command_constructor
79
12
  }
80
- /**
81
- * @internal
82
- */
83
13
  resolveMiddleware(clientStack, configuration, options) {
84
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
85
15
  const stack = clientStack.concat(this.middlewareStack);