aws_sdk_kms/operation/import_key_material/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::import_key_material::_import_key_material_output::ImportKeyMaterialOutputBuilder;
3
4pub use crate::operation::import_key_material::_import_key_material_input::ImportKeyMaterialInputBuilder;
5
6impl crate::operation::import_key_material::builders::ImportKeyMaterialInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::import_key_material::ImportKeyMaterialOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::import_key_material::ImportKeyMaterialError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.import_key_material();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ImportKeyMaterial`.
24///
25/// <p>Imports or reimports key material into an existing KMS key that was created without key material. You can also use this operation to set or update the expiration model and expiration date of the imported key material.</p>
26/// <p>By default, KMS creates KMS keys with key material that it generates. You can also generate and import your own key material. For more information about importing key material, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html">Importing key material</a>.</p>
27/// <p>For asymmetric and HMAC keys, you cannot change the key material after the initial import. You can import multiple key materials into symmetric encryption keys and rotate the key material on demand using <code>RotateKeyOnDemand</code>.</p>
28/// <p>You can import new key materials into multi-Region symmetric encryption keys. To do so, you must import the new key material into the primary Region key. Then you can import the same key materials into the replica Region keys. You cannot directly import new key material into the replica Region keys.</p>
29/// <p>To import new key material for a multi-Region symmetric key, you’ll need to complete the following:</p>
30/// <ol>
31/// <li>
32/// <p>Call <code>ImportKeyMaterial</code> on the primary Region key with the <code>ImportType</code>set to <code>NEW_KEY_MATERIAL</code>.</p></li>
33/// <li>
34/// <p>Call <code>ImportKeyMaterial</code> on the replica Region key with the <code>ImportType</code> set to <code>EXISTING_KEY_MATERIAL</code> using the same key material imported to the primary Region key. You must do this for every replica Region key before you can perform the <code>RotateKeyOnDemand</code> operation on the primary Region key.</p></li>
35/// </ol>
36/// <p>After you import key material, you can <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#reimport-key-material">reimport the same key material</a> into that KMS key or, if the key supports on-demand rotation, import new key material. You can use the <code>ImportType</code> parameter to indicate whether you are importing new key material or re-importing previously imported key material. You might reimport key material to replace key material that expired or key material that you deleted. You might also reimport key material to change the expiration model or expiration date of the key material.</p>
37/// <p>Each time you import key material into KMS, you can determine whether (<code>ExpirationModel</code>) and when (<code>ValidTo</code>) the key material expires. To change the expiration of your key material, you must import it again, either by calling <code>ImportKeyMaterial</code> or using the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-import-key-material-console">import features</a> of the KMS console.</p>
38/// <p>Before you call <code>ImportKeyMaterial</code>, complete these steps:</p>
39/// <ul>
40/// <li>
41/// <p>Create or identify a KMS key with <code>EXTERNAL</code> origin, which indicates that the KMS key is designed for imported key material.</p>
42/// <p>To create a new KMS key for imported key material, call the <code>CreateKey</code> operation with an <code>Origin</code> value of <code>EXTERNAL</code>. You can create a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, asymmetric key agreement key, or asymmetric signing KMS key. You can also import key material into a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">multi-Region key</a> of any supported type. However, you can't import key material into a KMS key in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-store-overview.html">custom key store</a>.</p></li>
43/// <li>
44/// <p>Call the <code>GetParametersForImport</code> operation to get a public key and import token set for importing key material.</p></li>
45/// <li>
46/// <p>Use the public key in the <code>GetParametersForImport</code> response to encrypt your key material.</p></li>
47/// </ul>
48/// <p>Then, in an <code>ImportKeyMaterial</code> request, you submit your encrypted key material and import token. When calling this operation, you must specify the following values:</p>
49/// <ul>
50/// <li>
51/// <p>The key ID or key ARN of the KMS key to associate with the imported key material. Its <code>Origin</code> must be <code>EXTERNAL</code> and its <code>KeyState</code> must be <code>PendingImport</code> or <code>Enabled</code>. You cannot perform this operation on a KMS key in a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-store-overview.html">custom key store</a>, or on a KMS key in a different Amazon Web Services account. To get the <code>Origin</code> and <code>KeyState</code> of a KMS key, call <code>DescribeKey</code>.</p></li>
52/// <li>
53/// <p>The encrypted key material.</p></li>
54/// <li>
55/// <p>The import token that <code>GetParametersForImport</code> returned. You must use a public key and token from the same <code>GetParametersForImport</code> response.</p></li>
56/// <li>
57/// <p>Whether the key material expires (<code>ExpirationModel</code>) and, if so, when (<code>ValidTo</code>). For help with this choice, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-expiration">Setting an expiration time</a> in the <i>Key Management Service Developer Guide</i>.</p>
58/// <p>If you set an expiration date, KMS deletes the key material from the KMS key on the specified date, making the KMS key unusable. To use the KMS key in cryptographic operations again, you must reimport the same key material. However, you can delete and reimport the key material at any time, including before the key material expires. Each time you reimport, you can eliminate or reset the expiration time.</p></li>
59/// </ul>
60/// <p>When this operation is successful, the state of the KMS key changes to <code>Enabled</code>, and you can use the KMS key in cryptographic operations. For symmetric encryption keys, you will need to import all of the key materials associated with the KMS key to change its state to <code>Enabled</code>. Use the <code>ListKeyRotations</code> operation to list the ID and import state of each key material associated with a KMS key.</p>
61/// <p>If this operation fails, use the exception to help determine the problem. If the error is related to the key material, the import token, or wrapping key, use <code>GetParametersForImport</code> to get a new public key and import token for the KMS key and repeat the import procedure. For help, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-conceptual.html">Create a KMS key with imported key material</a> in the <i>Key Management Service Developer Guide</i>.</p>
62/// <p>The KMS key that you use for this operation must be in a compatible key state. For details, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
63/// <p><b>Cross-account use</b>: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.</p>
64/// <p><b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ImportKeyMaterial</a> (key policy)</p>
65/// <p><b>Related operations:</b></p>
66/// <ul>
67/// <li>
68/// <p><code>DeleteImportedKeyMaterial</code></p></li>
69/// <li>
70/// <p><code>GetParametersForImport</code></p></li>
71/// <li>
72/// <p><code>ListKeyRotations</code></p></li>
73/// <li>
74/// <p><code>RotateKeyOnDemand</code></p></li>
75/// </ul>
76/// <p><b>Eventual consistency</b>: The KMS API follows an eventual consistency model. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/accessing-kms.html#programming-eventual-consistency">KMS eventual consistency</a>.</p>
77#[derive(::std::clone::Clone, ::std::fmt::Debug)]
78pub struct ImportKeyMaterialFluentBuilder {
79 handle: ::std::sync::Arc<crate::client::Handle>,
80 inner: crate::operation::import_key_material::builders::ImportKeyMaterialInputBuilder,
81 config_override: ::std::option::Option<crate::config::Builder>,
82}
83impl
84 crate::client::customize::internal::CustomizableSend<
85 crate::operation::import_key_material::ImportKeyMaterialOutput,
86 crate::operation::import_key_material::ImportKeyMaterialError,
87 > for ImportKeyMaterialFluentBuilder
88{
89 fn send(
90 self,
91 config_override: crate::config::Builder,
92 ) -> crate::client::customize::internal::BoxFuture<
93 crate::client::customize::internal::SendResult<
94 crate::operation::import_key_material::ImportKeyMaterialOutput,
95 crate::operation::import_key_material::ImportKeyMaterialError,
96 >,
97 > {
98 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
99 }
100}
101impl ImportKeyMaterialFluentBuilder {
102 /// Creates a new `ImportKeyMaterialFluentBuilder`.
103 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
104 Self {
105 handle,
106 inner: ::std::default::Default::default(),
107 config_override: ::std::option::Option::None,
108 }
109 }
110 /// Access the ImportKeyMaterial as a reference.
111 pub fn as_input(&self) -> &crate::operation::import_key_material::builders::ImportKeyMaterialInputBuilder {
112 &self.inner
113 }
114 /// Sends the request and returns the response.
115 ///
116 /// If an error occurs, an `SdkError` will be returned with additional details that
117 /// can be matched against.
118 ///
119 /// By default, any retryable failures will be retried twice. Retry behavior
120 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
121 /// set when configuring the client.
122 pub async fn send(
123 self,
124 ) -> ::std::result::Result<
125 crate::operation::import_key_material::ImportKeyMaterialOutput,
126 ::aws_smithy_runtime_api::client::result::SdkError<
127 crate::operation::import_key_material::ImportKeyMaterialError,
128 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
129 >,
130 > {
131 let input = self
132 .inner
133 .build()
134 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
135 let runtime_plugins = crate::operation::import_key_material::ImportKeyMaterial::operation_runtime_plugins(
136 self.handle.runtime_plugins.clone(),
137 &self.handle.conf,
138 self.config_override,
139 );
140 crate::operation::import_key_material::ImportKeyMaterial::orchestrate(&runtime_plugins, input).await
141 }
142
143 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
144 pub fn customize(
145 self,
146 ) -> crate::client::customize::CustomizableOperation<
147 crate::operation::import_key_material::ImportKeyMaterialOutput,
148 crate::operation::import_key_material::ImportKeyMaterialError,
149 Self,
150 > {
151 crate::client::customize::CustomizableOperation::new(self)
152 }
153 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
154 self.set_config_override(::std::option::Option::Some(config_override.into()));
155 self
156 }
157
158 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
159 self.config_override = config_override;
160 self
161 }
162 /// <p>The identifier of the KMS key that will be associated with the imported key material. This must be the same KMS key specified in the <code>KeyID</code> parameter of the corresponding <code>GetParametersForImport</code> request. The <code>Origin</code> of the KMS key must be <code>EXTERNAL</code> and its <code>KeyState</code> must be <code>PendingImport</code>.</p>
163 /// <p>The KMS key can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, or asymmetric signing KMS key, including a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">multi-Region key</a> of any supported type. You cannot perform this operation on a KMS key in a custom key store, or on a KMS key in a different Amazon Web Services account.</p>
164 /// <p>Specify the key ID or key ARN of the KMS key.</p>
165 /// <p>For example:</p>
166 /// <ul>
167 /// <li>
168 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
169 /// <li>
170 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
171 /// </ul>
172 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
173 pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174 self.inner = self.inner.key_id(input.into());
175 self
176 }
177 /// <p>The identifier of the KMS key that will be associated with the imported key material. This must be the same KMS key specified in the <code>KeyID</code> parameter of the corresponding <code>GetParametersForImport</code> request. The <code>Origin</code> of the KMS key must be <code>EXTERNAL</code> and its <code>KeyState</code> must be <code>PendingImport</code>.</p>
178 /// <p>The KMS key can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, or asymmetric signing KMS key, including a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">multi-Region key</a> of any supported type. You cannot perform this operation on a KMS key in a custom key store, or on a KMS key in a different Amazon Web Services account.</p>
179 /// <p>Specify the key ID or key ARN of the KMS key.</p>
180 /// <p>For example:</p>
181 /// <ul>
182 /// <li>
183 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
184 /// <li>
185 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
186 /// </ul>
187 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
188 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.inner = self.inner.set_key_id(input);
190 self
191 }
192 /// <p>The identifier of the KMS key that will be associated with the imported key material. This must be the same KMS key specified in the <code>KeyID</code> parameter of the corresponding <code>GetParametersForImport</code> request. The <code>Origin</code> of the KMS key must be <code>EXTERNAL</code> and its <code>KeyState</code> must be <code>PendingImport</code>.</p>
193 /// <p>The KMS key can be a symmetric encryption KMS key, HMAC KMS key, asymmetric encryption KMS key, or asymmetric signing KMS key, including a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">multi-Region key</a> of any supported type. You cannot perform this operation on a KMS key in a custom key store, or on a KMS key in a different Amazon Web Services account.</p>
194 /// <p>Specify the key ID or key ARN of the KMS key.</p>
195 /// <p>For example:</p>
196 /// <ul>
197 /// <li>
198 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
199 /// <li>
200 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
201 /// </ul>
202 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
203 pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
204 self.inner.get_key_id()
205 }
206 /// <p>The import token that you received in the response to a previous <code>GetParametersForImport</code> request. It must be from the same response that contained the public key that you used to encrypt the key material.</p>
207 pub fn import_token(mut self, input: ::aws_smithy_types::Blob) -> Self {
208 self.inner = self.inner.import_token(input);
209 self
210 }
211 /// <p>The import token that you received in the response to a previous <code>GetParametersForImport</code> request. It must be from the same response that contained the public key that you used to encrypt the key material.</p>
212 pub fn set_import_token(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
213 self.inner = self.inner.set_import_token(input);
214 self
215 }
216 /// <p>The import token that you received in the response to a previous <code>GetParametersForImport</code> request. It must be from the same response that contained the public key that you used to encrypt the key material.</p>
217 pub fn get_import_token(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
218 self.inner.get_import_token()
219 }
220 /// <p>The encrypted key material to import. The key material must be encrypted under the public wrapping key that <code>GetParametersForImport</code> returned, using the wrapping algorithm that you specified in the same <code>GetParametersForImport</code> request.</p>
221 pub fn encrypted_key_material(mut self, input: ::aws_smithy_types::Blob) -> Self {
222 self.inner = self.inner.encrypted_key_material(input);
223 self
224 }
225 /// <p>The encrypted key material to import. The key material must be encrypted under the public wrapping key that <code>GetParametersForImport</code> returned, using the wrapping algorithm that you specified in the same <code>GetParametersForImport</code> request.</p>
226 pub fn set_encrypted_key_material(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
227 self.inner = self.inner.set_encrypted_key_material(input);
228 self
229 }
230 /// <p>The encrypted key material to import. The key material must be encrypted under the public wrapping key that <code>GetParametersForImport</code> returned, using the wrapping algorithm that you specified in the same <code>GetParametersForImport</code> request.</p>
231 pub fn get_encrypted_key_material(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
232 self.inner.get_encrypted_key_material()
233 }
234 /// <p>The date and time when the imported key material expires. This parameter is required when the value of the <code>ExpirationModel</code> parameter is <code>KEY_MATERIAL_EXPIRES</code>. Otherwise it is not valid.</p>
235 /// <p>The value of this parameter must be a future date and time. The maximum value is 365 days from the request date.</p>
236 /// <p>When the key material expires, KMS deletes the key material from the KMS key. Without its key material, the KMS key is unusable. To use the KMS key in cryptographic operations, you must reimport the same key material.</p>
237 /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must delete (<code>DeleteImportedKeyMaterial</code>) and reimport the key material.</p>
238 pub fn valid_to(mut self, input: ::aws_smithy_types::DateTime) -> Self {
239 self.inner = self.inner.valid_to(input);
240 self
241 }
242 /// <p>The date and time when the imported key material expires. This parameter is required when the value of the <code>ExpirationModel</code> parameter is <code>KEY_MATERIAL_EXPIRES</code>. Otherwise it is not valid.</p>
243 /// <p>The value of this parameter must be a future date and time. The maximum value is 365 days from the request date.</p>
244 /// <p>When the key material expires, KMS deletes the key material from the KMS key. Without its key material, the KMS key is unusable. To use the KMS key in cryptographic operations, you must reimport the same key material.</p>
245 /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must delete (<code>DeleteImportedKeyMaterial</code>) and reimport the key material.</p>
246 pub fn set_valid_to(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
247 self.inner = self.inner.set_valid_to(input);
248 self
249 }
250 /// <p>The date and time when the imported key material expires. This parameter is required when the value of the <code>ExpirationModel</code> parameter is <code>KEY_MATERIAL_EXPIRES</code>. Otherwise it is not valid.</p>
251 /// <p>The value of this parameter must be a future date and time. The maximum value is 365 days from the request date.</p>
252 /// <p>When the key material expires, KMS deletes the key material from the KMS key. Without its key material, the KMS key is unusable. To use the KMS key in cryptographic operations, you must reimport the same key material.</p>
253 /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must delete (<code>DeleteImportedKeyMaterial</code>) and reimport the key material.</p>
254 pub fn get_valid_to(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
255 self.inner.get_valid_to()
256 }
257 /// <p>Specifies whether the key material expires. The default is <code>KEY_MATERIAL_EXPIRES</code>. For help with this choice, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-expiration">Setting an expiration time</a> in the <i>Key Management Service Developer Guide</i>.</p>
258 /// <p>When the value of <code>ExpirationModel</code> is <code>KEY_MATERIAL_EXPIRES</code>, you must specify a value for the <code>ValidTo</code> parameter. When value is <code>KEY_MATERIAL_DOES_NOT_EXPIRE</code>, you must omit the <code>ValidTo</code> parameter.</p>
259 /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must reimport the key material.</p>
260 pub fn expiration_model(mut self, input: crate::types::ExpirationModelType) -> Self {
261 self.inner = self.inner.expiration_model(input);
262 self
263 }
264 /// <p>Specifies whether the key material expires. The default is <code>KEY_MATERIAL_EXPIRES</code>. For help with this choice, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-expiration">Setting an expiration time</a> in the <i>Key Management Service Developer Guide</i>.</p>
265 /// <p>When the value of <code>ExpirationModel</code> is <code>KEY_MATERIAL_EXPIRES</code>, you must specify a value for the <code>ValidTo</code> parameter. When value is <code>KEY_MATERIAL_DOES_NOT_EXPIRE</code>, you must omit the <code>ValidTo</code> parameter.</p>
266 /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must reimport the key material.</p>
267 pub fn set_expiration_model(mut self, input: ::std::option::Option<crate::types::ExpirationModelType>) -> Self {
268 self.inner = self.inner.set_expiration_model(input);
269 self
270 }
271 /// <p>Specifies whether the key material expires. The default is <code>KEY_MATERIAL_EXPIRES</code>. For help with this choice, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-import-key-material.html#importing-keys-expiration">Setting an expiration time</a> in the <i>Key Management Service Developer Guide</i>.</p>
272 /// <p>When the value of <code>ExpirationModel</code> is <code>KEY_MATERIAL_EXPIRES</code>, you must specify a value for the <code>ValidTo</code> parameter. When value is <code>KEY_MATERIAL_DOES_NOT_EXPIRE</code>, you must omit the <code>ValidTo</code> parameter.</p>
273 /// <p>You cannot change the <code>ExpirationModel</code> or <code>ValidTo</code> values for the current import after the request completes. To change either value, you must reimport the key material.</p>
274 pub fn get_expiration_model(&self) -> &::std::option::Option<crate::types::ExpirationModelType> {
275 self.inner.get_expiration_model()
276 }
277 /// <p>Indicates whether the key material being imported is previously associated with this KMS key or not. This parameter is optional and only usable with symmetric encryption keys. If no key material has ever been imported into the KMS key, and this parameter is omitted, the parameter defaults to <code>NEW_KEY_MATERIAL</code>. After the first key material is imported, if this parameter is omitted then the parameter defaults to <code>EXISTING_KEY_MATERIAL</code>.</p>
278 /// <p>For multi-Region keys, you must first import new key material into the primary Region key. You should use the <code>NEW_KEY_MATERIAL</code> import type when importing key material into the primary Region key. Then, you can import the same key material into the replica Region key. The import type for the replica Region key should be <code>EXISTING_KEY_MATERIAL</code>.</p>
279 pub fn import_type(mut self, input: crate::types::ImportType) -> Self {
280 self.inner = self.inner.import_type(input);
281 self
282 }
283 /// <p>Indicates whether the key material being imported is previously associated with this KMS key or not. This parameter is optional and only usable with symmetric encryption keys. If no key material has ever been imported into the KMS key, and this parameter is omitted, the parameter defaults to <code>NEW_KEY_MATERIAL</code>. After the first key material is imported, if this parameter is omitted then the parameter defaults to <code>EXISTING_KEY_MATERIAL</code>.</p>
284 /// <p>For multi-Region keys, you must first import new key material into the primary Region key. You should use the <code>NEW_KEY_MATERIAL</code> import type when importing key material into the primary Region key. Then, you can import the same key material into the replica Region key. The import type for the replica Region key should be <code>EXISTING_KEY_MATERIAL</code>.</p>
285 pub fn set_import_type(mut self, input: ::std::option::Option<crate::types::ImportType>) -> Self {
286 self.inner = self.inner.set_import_type(input);
287 self
288 }
289 /// <p>Indicates whether the key material being imported is previously associated with this KMS key or not. This parameter is optional and only usable with symmetric encryption keys. If no key material has ever been imported into the KMS key, and this parameter is omitted, the parameter defaults to <code>NEW_KEY_MATERIAL</code>. After the first key material is imported, if this parameter is omitted then the parameter defaults to <code>EXISTING_KEY_MATERIAL</code>.</p>
290 /// <p>For multi-Region keys, you must first import new key material into the primary Region key. You should use the <code>NEW_KEY_MATERIAL</code> import type when importing key material into the primary Region key. Then, you can import the same key material into the replica Region key. The import type for the replica Region key should be <code>EXISTING_KEY_MATERIAL</code>.</p>
291 pub fn get_import_type(&self) -> &::std::option::Option<crate::types::ImportType> {
292 self.inner.get_import_type()
293 }
294 /// <p>Description for the key material being imported. This parameter is optional and only usable with symmetric encryption keys. If you do not specify a key material description, KMS retains the value you specified when you last imported the same key material into this KMS key.</p>
295 pub fn key_material_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
296 self.inner = self.inner.key_material_description(input.into());
297 self
298 }
299 /// <p>Description for the key material being imported. This parameter is optional and only usable with symmetric encryption keys. If you do not specify a key material description, KMS retains the value you specified when you last imported the same key material into this KMS key.</p>
300 pub fn set_key_material_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301 self.inner = self.inner.set_key_material_description(input);
302 self
303 }
304 /// <p>Description for the key material being imported. This parameter is optional and only usable with symmetric encryption keys. If you do not specify a key material description, KMS retains the value you specified when you last imported the same key material into this KMS key.</p>
305 pub fn get_key_material_description(&self) -> &::std::option::Option<::std::string::String> {
306 self.inner.get_key_material_description()
307 }
308 /// <p>Identifies the key material being imported. This parameter is optional and only usable with symmetric encryption keys. You cannot specify a key material ID with <code>ImportType</code> set to <code>NEW_KEY_MATERIAL</code>. Whenever you import key material into a symmetric encryption key, KMS assigns a unique identifier to the key material based on the KMS key ID and the imported key material. When you re-import key material with a specified key material ID, KMS:</p>
309 /// <ul>
310 /// <li>
311 /// <p>Computes the identifier for the key material</p></li>
312 /// <li>
313 /// <p>Matches the computed identifier against the specified key material ID</p></li>
314 /// <li>
315 /// <p>Verifies that the key material ID is already associated with the KMS key</p></li>
316 /// </ul>
317 /// <p>To get the list of key material IDs associated with a KMS key, use <code>ListKeyRotations</code>.</p>
318 pub fn key_material_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
319 self.inner = self.inner.key_material_id(input.into());
320 self
321 }
322 /// <p>Identifies the key material being imported. This parameter is optional and only usable with symmetric encryption keys. You cannot specify a key material ID with <code>ImportType</code> set to <code>NEW_KEY_MATERIAL</code>. Whenever you import key material into a symmetric encryption key, KMS assigns a unique identifier to the key material based on the KMS key ID and the imported key material. When you re-import key material with a specified key material ID, KMS:</p>
323 /// <ul>
324 /// <li>
325 /// <p>Computes the identifier for the key material</p></li>
326 /// <li>
327 /// <p>Matches the computed identifier against the specified key material ID</p></li>
328 /// <li>
329 /// <p>Verifies that the key material ID is already associated with the KMS key</p></li>
330 /// </ul>
331 /// <p>To get the list of key material IDs associated with a KMS key, use <code>ListKeyRotations</code>.</p>
332 pub fn set_key_material_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
333 self.inner = self.inner.set_key_material_id(input);
334 self
335 }
336 /// <p>Identifies the key material being imported. This parameter is optional and only usable with symmetric encryption keys. You cannot specify a key material ID with <code>ImportType</code> set to <code>NEW_KEY_MATERIAL</code>. Whenever you import key material into a symmetric encryption key, KMS assigns a unique identifier to the key material based on the KMS key ID and the imported key material. When you re-import key material with a specified key material ID, KMS:</p>
337 /// <ul>
338 /// <li>
339 /// <p>Computes the identifier for the key material</p></li>
340 /// <li>
341 /// <p>Matches the computed identifier against the specified key material ID</p></li>
342 /// <li>
343 /// <p>Verifies that the key material ID is already associated with the KMS key</p></li>
344 /// </ul>
345 /// <p>To get the list of key material IDs associated with a KMS key, use <code>ListKeyRotations</code>.</p>
346 pub fn get_key_material_id(&self) -> &::std::option::Option<::std::string::String> {
347 self.inner.get_key_material_id()
348 }
349}