@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,97 +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>Adds a grant to a KMS key. </p>
10
- * <p>A <i>grant</i> is a policy instrument that allows Amazon Web Services principals to use
11
- * KMS keys in cryptographic operations. It also can allow them to view a KMS key (<a>DescribeKey</a>) and create and manage grants. When authorizing access to a KMS key,
12
- * grants are considered along with key policies and IAM policies. Grants are often used for
13
- * temporary permissions because you can create one, use its permissions, and delete it without
14
- * changing your key policies or IAM policies. </p>
15
- * <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
16
- * <i>
17
- * <i>Key Management Service Developer Guide</i>
18
- * </i>. For examples of working with grants in several
19
- * programming languages, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html">Programming grants</a>. </p>
20
- * <p>The <code>CreateGrant</code> operation returns a <code>GrantToken</code> and a
21
- * <code>GrantId</code>.</p>
22
- * <ul>
23
- * <li>
24
- * <p>When you create, retire, or revoke a grant, there might be a brief delay, usually less than five minutes, until the grant is available throughout KMS. This state is known as <i>eventual consistency</i>. Once the grant has achieved eventual consistency, the grantee
25
- * principal can use the permissions in the grant without identifying the grant. </p>
26
- * <p>However, to use the permissions in the grant immediately, use the
27
- * <code>GrantToken</code> that <code>CreateGrant</code> returns. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a
28
- * grant token</a> in the <i>
29
- * <i>Key Management Service Developer Guide</i>
30
- * </i>.</p>
31
- * </li>
32
- * <li>
33
- * <p>The <code>CreateGrant</code> operation also returns a <code>GrantId</code>. You can
34
- * use the <code>GrantId</code> and a key identifier to identify the grant in the <a>RetireGrant</a> and <a>RevokeGrant</a> operations. To find the grant
35
- * ID, use the <a>ListGrants</a> or <a>ListRetirableGrants</a>
36
- * operations.</p>
37
- * </li>
38
- * </ul>
39
- * <p>The KMS key that you use for this operation must be in a compatible key state. For
40
- * 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>
41
- * <p>
42
- * <b>Cross-account use</b>: Yes.
43
- * To perform this operation on a KMS key in a different Amazon Web Services account, specify the key
44
- * ARN in the value of the <code>KeyId</code> parameter. </p>
45
- * <p>
46
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:CreateGrant</a> (key policy)</p>
47
- * <p>
48
- * <b>Related operations:</b>
49
- * </p>
50
- * <ul>
51
- * <li>
52
- * <p>
53
- * <a>ListGrants</a>
54
- * </p>
55
- * </li>
56
- * <li>
57
- * <p>
58
- * <a>ListRetirableGrants</a>
59
- * </p>
60
- * </li>
61
- * <li>
62
- * <p>
63
- * <a>RetireGrant</a>
64
- * </p>
65
- * </li>
66
- * <li>
67
- * <p>
68
- * <a>RevokeGrant</a>
69
- * </p>
70
- * </li>
71
- * </ul>
72
- * @example
73
- * Use a bare-bones client and the command you need to make an API call.
74
- * ```javascript
75
- * import { KMSClient, CreateGrantCommand } from "@aws-sdk/client-kms"; // ES Modules import
76
- * // const { KMSClient, CreateGrantCommand } = require("@aws-sdk/client-kms"); // CommonJS import
77
- * const client = new KMSClient(config);
78
- * const command = new CreateGrantCommand(input);
79
- * const response = await client.send(command);
80
- * ```
81
- *
82
- * @see {@link CreateGrantCommandInput} for command's `input` shape.
83
- * @see {@link CreateGrantCommandOutput} for command's `response` shape.
84
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
85
- *
86
- */
87
8
  class CreateGrantCommand extends smithy_client_1.Command {
88
- // Start section: command_properties
89
- // End section: command_properties
90
9
  constructor(input) {
91
- // Start section: command_constructor
92
10
  super();
93
11
  this.input = input;
94
- // End section: command_constructor
95
12
  }
96
- /**
97
- * @internal
98
- */
99
13
  resolveMiddleware(clientStack, configuration, options) {
100
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
101
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,159 +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>Creates a unique customer managed <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys">KMS key</a> in your Amazon Web Services account and
10
- * Region.</p>
11
- * <note>
12
- * <p>KMS is replacing the term <i>customer master key (CMK)</i> with <i>KMS key</i> and <i>KMS key</i>. The concept has not changed. To prevent breaking changes, KMS is keeping some variations of this term.</p>
13
- * </note>
14
- *
15
- * <p>You can use the <code>CreateKey</code> operation to create symmetric or asymmetric KMS
16
- * keys.</p>
17
- * <ul>
18
- * <li>
19
- * <p>
20
- * <b>Symmetric KMS keys</b> contain a 256-bit symmetric key
21
- * that never leaves KMS unencrypted. To use the KMS key, you must call KMS. You can use
22
- * a symmetric KMS key to encrypt and decrypt small amounts of data, but they are typically
23
- * used to generate <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys">data keys</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs">data keys pairs</a>. For details,
24
- * see <a>GenerateDataKey</a> and <a>GenerateDataKeyPair</a>.</p>
25
- * </li>
26
- * <li>
27
- * <p>
28
- * <b>Asymmetric KMS keys</b> can contain an RSA key pair or an
29
- * Elliptic Curve (ECC) key pair. The private key in an asymmetric KMS key never leaves KMS
30
- * unencrypted. However, you can use the <a>GetPublicKey</a> operation to download
31
- * the public key so it can be used outside of KMS. KMS keys with RSA key pairs can be used
32
- * to encrypt or decrypt data or sign and verify messages (but not both). KMS keys with ECC
33
- * key pairs can be used only to sign and verify messages.</p>
34
- * </li>
35
- * </ul>
36
- * <p>For information about symmetric and asymmetric KMS keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
37
- *
38
- *
39
- * <p>To create different types of KMS keys, use the following guidance:</p>
40
- *
41
- * <dl>
42
- * <dt>Asymmetric KMS keys</dt>
43
- * <dd>
44
- * <p>To create an asymmetric KMS key, use the <code>KeySpec</code> parameter to specify
45
- * the type of key material in the KMS key. Then, use the <code>KeyUsage</code> parameter
46
- * to determine whether the KMS key will be used to encrypt and decrypt or sign and verify.
47
- * You can't change these properties after the KMS key is created.</p>
48
- * <p> </p>
49
- * </dd>
50
- * <dt>Symmetric KMS keys</dt>
51
- * <dd>
52
- * <p>When creating a symmetric KMS key, you don't need to specify the
53
- * <code>KeySpec</code> or <code>KeyUsage</code> parameters. The default value for
54
- * <code>KeySpec</code>, <code>SYMMETRIC_DEFAULT</code>, and the default value for
55
- * <code>KeyUsage</code>, <code>ENCRYPT_DECRYPT</code>, are the only valid values for
56
- * symmetric KMS keys. </p>
57
- * <p> </p>
58
- * </dd>
59
- * <dt>Multi-Region primary keys</dt>
60
- * <dt>Imported key material</dt>
61
- * <dd>
62
- * <p>To create a multi-Region <i>primary key</i> in the local Amazon Web Services Region,
63
- * use the <code>MultiRegion</code> parameter with a value of <code>True</code>. To create
64
- * a multi-Region <i>replica key</i>, that is, a KMS key with the same key ID
65
- * and key material as a primary key, but in a different Amazon Web Services Region, use the <a>ReplicateKey</a> operation. To change a replica key to a primary key, and its
66
- * primary key to a replica key, use the <a>UpdatePrimaryRegion</a>
67
- * operation.</p>
68
- * <p>This operation supports <i>multi-Region keys</i>, an KMS feature that lets you create multiple
69
- * interoperable KMS keys in different Amazon Web Services Regions. Because these KMS keys have the same key ID, key
70
- * material, and other metadata, you can use them interchangeably to encrypt data in one Amazon Web Services Region and decrypt
71
- * 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>
72
- * <p>You can create symmetric and asymmetric multi-Region keys and multi-Region keys with
73
- * imported key material. You cannot create multi-Region keys in a custom key store.</p>
74
- * <p> </p>
75
- * </dd>
76
- * <dd>
77
- * <p>To import your own key material, begin by creating a symmetric KMS key with no key
78
- * material. To do this, use the <code>Origin</code> parameter of <code>CreateKey</code>
79
- * with a value of <code>EXTERNAL</code>. Next, use <a>GetParametersForImport</a> operation to get a public key and import token, and use the public key to encrypt
80
- * your key material. Then, use <a>ImportKeyMaterial</a> with your import token
81
- * to import the key material. For step-by-step instructions, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">Importing Key Material</a> in the <i>
82
- * <i>Key Management Service Developer Guide</i>
83
- * </i>. You
84
- * cannot import the key material into an asymmetric KMS key.</p>
85
- * <p>To create a multi-Region primary key with imported key material, use the
86
- * <code>Origin</code> parameter of <code>CreateKey</code> with a value of
87
- * <code>EXTERNAL</code> and the <code>MultiRegion</code> parameter with a value of
88
- * <code>True</code>. To create replicas of the multi-Region primary key, use the <a>ReplicateKey</a> operation. 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>
89
- * <p> </p>
90
- * </dd>
91
- * <dt>Custom key store</dt>
92
- * <dd>
93
- * <p>To create a symmetric KMS key in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key store</a>, use the
94
- * <code>CustomKeyStoreId</code> parameter to specify the custom key store. You must also
95
- * use the <code>Origin</code> parameter with a value of <code>AWS_CLOUDHSM</code>. The
96
- * CloudHSM cluster that is associated with the custom key store must have at least two active
97
- * HSMs in different Availability Zones in the Amazon Web Services Region. </p>
98
- * <p>You cannot create an asymmetric KMS key in a custom key store. For information about
99
- * custom key stores in KMS see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">Using Custom Key Stores</a> in
100
- * the <i>
101
- * <i>Key Management Service Developer Guide</i>
102
- * </i>.</p>
103
- * </dd>
104
- * </dl>
105
- * <p>
106
- * <b>Cross-account use</b>: No. You cannot use this operation to
107
- * create a KMS key in a different Amazon Web Services account.</p>
108
- *
109
- * <p>
110
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:CreateKey</a> (IAM policy). To use the
111
- * <code>Tags</code> parameter, <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:TagResource</a> (IAM policy). For examples and information about related
112
- * permissions, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key">Allow a user to create
113
- * KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
114
- * <p>
115
- * <b>Related operations:</b>
116
- * </p>
117
- * <ul>
118
- * <li>
119
- * <p>
120
- * <a>DescribeKey</a>
121
- * </p>
122
- * </li>
123
- * <li>
124
- * <p>
125
- * <a>ListKeys</a>
126
- * </p>
127
- * </li>
128
- * <li>
129
- * <p>
130
- * <a>ScheduleKeyDeletion</a>
131
- * </p>
132
- * </li>
133
- * </ul>
134
- * @example
135
- * Use a bare-bones client and the command you need to make an API call.
136
- * ```javascript
137
- * import { KMSClient, CreateKeyCommand } from "@aws-sdk/client-kms"; // ES Modules import
138
- * // const { KMSClient, CreateKeyCommand } = require("@aws-sdk/client-kms"); // CommonJS import
139
- * const client = new KMSClient(config);
140
- * const command = new CreateKeyCommand(input);
141
- * const response = await client.send(command);
142
- * ```
143
- *
144
- * @see {@link CreateKeyCommandInput} for command's `input` shape.
145
- * @see {@link CreateKeyCommandOutput} for command's `response` shape.
146
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
147
- *
148
- */
149
8
  class CreateKeyCommand extends smithy_client_1.Command {
150
- // Start section: command_properties
151
- // End section: command_properties
152
9
  constructor(input) {
153
- // Start section: command_constructor
154
10
  super();
155
11
  this.input = input;
156
- // End section: command_constructor
157
12
  }
158
- /**
159
- * @internal
160
- */
161
13
  resolveMiddleware(clientStack, configuration, options) {
162
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
163
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,123 +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 that was encrypted by a KMS key using any of the following
10
- * operations:</p>
11
- * <ul>
12
- * <li>
13
- * <p>
14
- * <a>Encrypt</a>
15
- * </p>
16
- * </li>
17
- * <li>
18
- * <p>
19
- * <a>GenerateDataKey</a>
20
- * </p>
21
- * </li>
22
- * <li>
23
- * <p>
24
- * <a>GenerateDataKeyPair</a>
25
- * </p>
26
- * </li>
27
- * <li>
28
- * <p>
29
- * <a>GenerateDataKeyWithoutPlaintext</a>
30
- * </p>
31
- * </li>
32
- * <li>
33
- * <p>
34
- * <a>GenerateDataKeyPairWithoutPlaintext</a>
35
- * </p>
36
- * </li>
37
- * </ul>
38
- * <p>You can use this operation to decrypt ciphertext that was encrypted under a symmetric or
39
- * asymmetric KMS key. When the KMS key is asymmetric, you must specify the KMS key and the
40
- * encryption algorithm that was used to encrypt the ciphertext. For information about symmetric and asymmetric KMS keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
41
- * <p>The Decrypt operation also decrypts ciphertext that was encrypted outside of KMS by the
42
- * public key in an KMS asymmetric KMS key. However, it cannot decrypt ciphertext produced by
43
- * other libraries, such as the <a href="https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/">Amazon Web Services
44
- * Encryption SDK</a> or <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html">Amazon S3 client-side encryption</a>.
45
- * These libraries return a ciphertext format that is incompatible with KMS.</p>
46
- * <p>If the ciphertext was encrypted under a symmetric KMS key, the <code>KeyId</code>
47
- * parameter is optional. KMS can get this information from metadata that it adds to the
48
- * symmetric ciphertext blob. This feature adds durability to your implementation by ensuring
49
- * that authorized users can decrypt ciphertext decades after it was encrypted, even if they've
50
- * lost track of the key ID. However, specifying the KMS key is always recommended as a best
51
- * practice. When you use the <code>KeyId</code> parameter to specify a KMS key, KMS only uses
52
- * the KMS key you specify. If the ciphertext was encrypted under a different KMS key, the
53
- * <code>Decrypt</code> operation fails. This practice ensures that you use the KMS key that
54
- * you intend.</p>
55
- * <p>Whenever possible, use key policies to give users permission to call the
56
- * <code>Decrypt</code> operation on a particular KMS key, instead of using IAM policies.
57
- * Otherwise, you might create an IAM user policy that gives the user <code>Decrypt</code>
58
- * permission on all KMS keys. This user could decrypt ciphertext that was encrypted by KMS keys
59
- * in other accounts if the key policy for the cross-account KMS key permits it. If you must use
60
- * an IAM policy for <code>Decrypt</code> permissions, limit the user to particular KMS keys or
61
- * particular trusted accounts. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policies-best-practices">Best practices for IAM
62
- * policies</a> in the <i>Key Management Service Developer Guide</i>.</p>
63
- * <p>Applications in Amazon Web Services Nitro Enclaves can call this operation by using the <a href="https://github.com/aws/aws-nitro-enclaves-sdk-c">Amazon Web Services Nitro Enclaves Development Kit</a>. For information about the supporting parameters, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves use KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
64
- * <p>The KMS key that you use for this operation must be in a compatible key state. For
65
- * 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>
66
- * <p>
67
- * <b>Cross-account
68
- * use</b>: Yes. To perform this operation with a KMS key in a different Amazon Web Services account, specify
69
- * the key ARN or alias ARN in the value of the <code>KeyId</code> parameter. </p>
70
- *
71
- * <p>
72
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:Decrypt</a> (key policy)</p>
73
- * <p>
74
- * <b>Related operations:</b>
75
- * </p>
76
- * <ul>
77
- * <li>
78
- * <p>
79
- * <a>Encrypt</a>
80
- * </p>
81
- * </li>
82
- * <li>
83
- * <p>
84
- * <a>GenerateDataKey</a>
85
- * </p>
86
- * </li>
87
- * <li>
88
- * <p>
89
- * <a>GenerateDataKeyPair</a>
90
- * </p>
91
- * </li>
92
- * <li>
93
- * <p>
94
- * <a>ReEncrypt</a>
95
- * </p>
96
- * </li>
97
- * </ul>
98
- * @example
99
- * Use a bare-bones client and the command you need to make an API call.
100
- * ```javascript
101
- * import { KMSClient, DecryptCommand } from "@aws-sdk/client-kms"; // ES Modules import
102
- * // const { KMSClient, DecryptCommand } = require("@aws-sdk/client-kms"); // CommonJS import
103
- * const client = new KMSClient(config);
104
- * const command = new DecryptCommand(input);
105
- * const response = await client.send(command);
106
- * ```
107
- *
108
- * @see {@link DecryptCommandInput} for command's `input` shape.
109
- * @see {@link DecryptCommandOutput} for command's `response` shape.
110
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
111
- *
112
- */
113
8
  class DecryptCommand extends smithy_client_1.Command {
114
- // Start section: command_properties
115
- // End section: command_properties
116
9
  constructor(input) {
117
- // Start section: command_constructor
118
10
  super();
119
11
  this.input = input;
120
- // End section: command_constructor
121
12
  }
122
- /**
123
- * @internal
124
- */
125
13
  resolveMiddleware(clientStack, configuration, options) {
126
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
127
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,82 +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 the specified alias. </p>
10
- * <note>
11
- * <p>Adding, deleting, or updating an alias can allow or deny permission to the KMS key. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/abac.html">Using ABAC in KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
12
- * </note>
13
- * <p>Because an alias is not a property of a KMS key, you can delete and change the aliases of
14
- * a KMS key without affecting the KMS key. Also, aliases do not appear in the response from the
15
- * <a>DescribeKey</a> operation. To get the aliases of all KMS keys, use the <a>ListAliases</a> operation. </p>
16
- * <p>Each KMS key can have multiple aliases. To change the alias of a KMS key, use <a>DeleteAlias</a> to delete the current alias and <a>CreateAlias</a> to
17
- * create a new alias. To associate an existing alias with a different KMS key, call <a>UpdateAlias</a>.</p>
18
- * <p>
19
- * <b>Cross-account use</b>: No. You cannot perform this operation on an alias in a different Amazon Web Services account.</p>
20
- * <p>
21
- * <b>Required permissions</b>
22
- * </p>
23
- * <ul>
24
- * <li>
25
- * <p>
26
- * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:DeleteAlias</a> on
27
- * the alias (IAM policy).</p>
28
- * </li>
29
- * <li>
30
- * <p>
31
- * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:DeleteAlias</a> on
32
- * the KMS key (key policy).</p>
33
- * </li>
34
- * </ul>
35
- * <p>For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access">Controlling access to aliases</a> in the
36
- * <i>Key Management Service Developer Guide</i>.</p>
37
- * <p>
38
- * <b>Related operations:</b>
39
- * </p>
40
- * <ul>
41
- * <li>
42
- * <p>
43
- * <a>CreateAlias</a>
44
- * </p>
45
- * </li>
46
- * <li>
47
- * <p>
48
- * <a>ListAliases</a>
49
- * </p>
50
- * </li>
51
- * <li>
52
- * <p>
53
- * <a>UpdateAlias</a>
54
- * </p>
55
- * </li>
56
- * </ul>
57
- * @example
58
- * Use a bare-bones client and the command you need to make an API call.
59
- * ```javascript
60
- * import { KMSClient, DeleteAliasCommand } from "@aws-sdk/client-kms"; // ES Modules import
61
- * // const { KMSClient, DeleteAliasCommand } = require("@aws-sdk/client-kms"); // CommonJS import
62
- * const client = new KMSClient(config);
63
- * const command = new DeleteAliasCommand(input);
64
- * const response = await client.send(command);
65
- * ```
66
- *
67
- * @see {@link DeleteAliasCommandInput} for command's `input` shape.
68
- * @see {@link DeleteAliasCommandOutput} for command's `response` shape.
69
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
70
- *
71
- */
72
8
  class DeleteAliasCommand extends smithy_client_1.Command {
73
- // Start section: command_properties
74
- // End section: command_properties
75
9
  constructor(input) {
76
- // Start section: command_constructor
77
10
  super();
78
11
  this.input = input;
79
- // End section: command_constructor
80
12
  }
81
- /**
82
- * @internal
83
- */
84
13
  resolveMiddleware(clientStack, configuration, options) {
85
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
86
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,89 +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 <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key store</a>. This operation does not delete the CloudHSM cluster that is
10
- * associated with the custom key store, or affect any users or keys in the cluster.</p>
11
- * <p>The custom key store that you delete cannot contain any KMS <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys">KMS keys</a>. Before deleting the key store,
12
- * verify that you will never need to use any of the KMS keys in the key store for any
13
- * <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic operations</a>. Then, use <a>ScheduleKeyDeletion</a> to delete the KMS keys from the
14
- * key store. When the scheduled waiting period expires, the <code>ScheduleKeyDeletion</code>
15
- * operation deletes the KMS keys. Then it makes a best effort to delete the key material from
16
- * the associated cluster. However, you might need to manually <a href="https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key">delete the orphaned key
17
- * material</a> from the cluster and its backups.</p>
18
- * <p>After all KMS keys are deleted from KMS, use <a>DisconnectCustomKeyStore</a>
19
- * to disconnect the key store from KMS. Then, you can delete the custom key store.</p>
20
- * <p>Instead of deleting the custom key store, consider using <a>DisconnectCustomKeyStore</a> to disconnect it from KMS. While the key store is
21
- * disconnected, you cannot create or use the KMS keys in the key store. But, you do not need to
22
- * delete KMS keys and you can reconnect a disconnected custom key store at any time.</p>
23
- * <p>If the operation succeeds, it returns a JSON object with no
24
- * properties.</p>
25
- * <p>This operation is part of the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">Custom Key Store feature</a> feature in KMS, which
26
- * combines the convenience and extensive integration of KMS with the isolation and control of a
27
- * single-tenant key store.</p>
28
- * <p>
29
- * <b>Cross-account use</b>: No.
30
- * You cannot perform this operation on a custom key store in a different Amazon Web Services account.</p>
31
- *
32
- * <p>
33
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:DeleteCustomKeyStore</a> (IAM policy)</p>
34
- * <p>
35
- * <b>Related operations:</b>
36
- * </p>
37
- * <ul>
38
- * <li>
39
- * <p>
40
- * <a>ConnectCustomKeyStore</a>
41
- * </p>
42
- * </li>
43
- * <li>
44
- * <p>
45
- * <a>CreateCustomKeyStore</a>
46
- * </p>
47
- * </li>
48
- * <li>
49
- * <p>
50
- * <a>DescribeCustomKeyStores</a>
51
- * </p>
52
- * </li>
53
- * <li>
54
- * <p>
55
- * <a>DisconnectCustomKeyStore</a>
56
- * </p>
57
- * </li>
58
- * <li>
59
- * <p>
60
- * <a>UpdateCustomKeyStore</a>
61
- * </p>
62
- * </li>
63
- * </ul>
64
- * @example
65
- * Use a bare-bones client and the command you need to make an API call.
66
- * ```javascript
67
- * import { KMSClient, DeleteCustomKeyStoreCommand } from "@aws-sdk/client-kms"; // ES Modules import
68
- * // const { KMSClient, DeleteCustomKeyStoreCommand } = require("@aws-sdk/client-kms"); // CommonJS import
69
- * const client = new KMSClient(config);
70
- * const command = new DeleteCustomKeyStoreCommand(input);
71
- * const response = await client.send(command);
72
- * ```
73
- *
74
- * @see {@link DeleteCustomKeyStoreCommandInput} for command's `input` shape.
75
- * @see {@link DeleteCustomKeyStoreCommandOutput} for command's `response` shape.
76
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
77
- *
78
- */
79
8
  class DeleteCustomKeyStoreCommand extends smithy_client_1.Command {
80
- // Start section: command_properties
81
- // End section: command_properties
82
9
  constructor(input) {
83
- // Start section: command_constructor
84
10
  super();
85
11
  this.input = input;
86
- // End section: command_constructor
87
12
  }
88
- /**
89
- * @internal
90
- */
91
13
  resolveMiddleware(clientStack, configuration, options) {
92
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
93
15
  const stack = clientStack.concat(this.middlewareStack);
@@ -5,64 +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 key material that you previously imported. This operation makes the specified KMS
10
- * key unusable. For more information about importing key material into KMS, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">Importing Key Material</a>
11
- * in the <i>Key Management Service Developer Guide</i>. </p>
12
- * <p>When the specified KMS key is in the <code>PendingDeletion</code> state, this operation
13
- * does not change the KMS key's state. Otherwise, it changes the KMS key's state to
14
- * <code>PendingImport</code>.</p>
15
- * <p>After you delete key material, you can use <a>ImportKeyMaterial</a> to reimport
16
- * the same key material into the KMS key.</p>
17
- * <p>The KMS key that you use for this operation must be in a compatible key state. For
18
- * 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>
19
- * <p>
20
- * <b>Cross-account use</b>: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.</p>
21
- *
22
- * <p>
23
- * <b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:DeleteImportedKeyMaterial</a> (key policy)</p>
24
- * <p>
25
- * <b>Related operations:</b>
26
- * </p>
27
- * <ul>
28
- * <li>
29
- * <p>
30
- * <a>GetParametersForImport</a>
31
- * </p>
32
- * </li>
33
- * <li>
34
- * <p>
35
- * <a>ImportKeyMaterial</a>
36
- * </p>
37
- * </li>
38
- * </ul>
39
- * @example
40
- * Use a bare-bones client and the command you need to make an API call.
41
- * ```javascript
42
- * import { KMSClient, DeleteImportedKeyMaterialCommand } from "@aws-sdk/client-kms"; // ES Modules import
43
- * // const { KMSClient, DeleteImportedKeyMaterialCommand } = require("@aws-sdk/client-kms"); // CommonJS import
44
- * const client = new KMSClient(config);
45
- * const command = new DeleteImportedKeyMaterialCommand(input);
46
- * const response = await client.send(command);
47
- * ```
48
- *
49
- * @see {@link DeleteImportedKeyMaterialCommandInput} for command's `input` shape.
50
- * @see {@link DeleteImportedKeyMaterialCommandOutput} for command's `response` shape.
51
- * @see {@link KMSClientResolvedConfig | config} for command's `input` shape.
52
- *
53
- */
54
8
  class DeleteImportedKeyMaterialCommand extends smithy_client_1.Command {
55
- // Start section: command_properties
56
- // End section: command_properties
57
9
  constructor(input) {
58
- // Start section: command_constructor
59
10
  super();
60
11
  this.input = input;
61
- // End section: command_constructor
62
12
  }
63
- /**
64
- * @internal
65
- */
66
13
  resolveMiddleware(clientStack, configuration, options) {
67
14
  this.middlewareStack.use(middleware_serde_1.getSerdePlugin(configuration, this.serialize, this.deserialize));
68
15
  const stack = clientStack.concat(this.middlewareStack);