aws_sdk_kms/operation/generate_data_key/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::generate_data_key::_generate_data_key_output::GenerateDataKeyOutputBuilder;
3
4pub use crate::operation::generate_data_key::_generate_data_key_input::GenerateDataKeyInputBuilder;
5
6impl crate::operation::generate_data_key::builders::GenerateDataKeyInputBuilder {
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::generate_data_key::GenerateDataKeyOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::generate_data_key::GenerateDataKeyError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.generate_data_key();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GenerateDataKey`.
24///
25/// <p>Returns a unique symmetric data key for use outside of KMS. This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify. The bytes in the plaintext key are random; they are not related to the caller or the KMS key. You can use the plaintext key to encrypt your data outside of KMS and store the encrypted data key with the encrypted data.</p>
26/// <p>To generate a data key, specify the symmetric encryption KMS key that will be used to encrypt the data key. You cannot use an asymmetric KMS key to encrypt data keys. To get the type of your KMS key, use the <code>DescribeKey</code> operation.</p>
27/// <p>You must also specify the length of the data key. Use either the <code>KeySpec</code> or <code>NumberOfBytes</code> parameters (but not both). For 128-bit and 256-bit data keys, use the <code>KeySpec</code> parameter.</p>
28/// <p>To generate a 128-bit SM4 data key (China Regions only), specify a <code>KeySpec</code> value of <code>AES_128</code> or a <code>NumberOfBytes</code> value of <code>16</code>. The symmetric encryption key used in China Regions to encrypt your data key is an SM4 encryption key.</p>
29/// <p>To get only an encrypted copy of the data key, use <code>GenerateDataKeyWithoutPlaintext</code>. To generate an asymmetric data key pair, use the <code>GenerateDataKeyPair</code> or <code>GenerateDataKeyPairWithoutPlaintext</code> operation. To get a cryptographically secure random byte string, use <code>GenerateRandom</code>.</p>
30/// <p>You can use an optional encryption context to add additional security to the encryption operation. If you specify an <code>EncryptionContext</code>, you must specify the same encryption context (a case-sensitive exact match) when decrypting the encrypted data key. Otherwise, the request to decrypt fails with an <code>InvalidCiphertextException</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption Context</a> in the <i>Key Management Service Developer Guide</i>.</p>
31/// <p><code>GenerateDataKey</code> also supports <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave.html">Amazon Web Services Nitro Enclaves</a>, which provide an isolated compute environment in Amazon EC2. To call <code>GenerateDataKey</code> for an Amazon Web Services Nitro enclave, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK. Use the <code>Recipient</code> parameter to provide the attestation document for the enclave. <code>GenerateDataKey</code> returns a copy of the data key encrypted under the specified KMS key, as usual. But instead of a plaintext copy of the data key, the response includes a copy of the data key encrypted under the public key from the attestation document (<code>CiphertextForRecipient</code>). For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>..</p>
32/// <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>
33/// <p><b>How to use your data key</b></p>
34/// <p>We recommend that you use the following pattern to encrypt data locally in your application. You can write your own code or use a client-side encryption library, such as the <a href="https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/">Amazon Web Services Encryption SDK</a>, the <a href="https://docs.aws.amazon.com/dynamodb-encryption-client/latest/devguide/">Amazon DynamoDB Encryption Client</a>, or <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html">Amazon S3 client-side encryption</a> to do these tasks for you.</p>
35/// <p>To encrypt data outside of KMS:</p>
36/// <ol>
37/// <li>
38/// <p>Use the <code>GenerateDataKey</code> operation to get a data key.</p></li>
39/// <li>
40/// <p>Use the plaintext data key (in the <code>Plaintext</code> field of the response) to encrypt your data outside of KMS. Then erase the plaintext data key from memory.</p></li>
41/// <li>
42/// <p>Store the encrypted data key (in the <code>CiphertextBlob</code> field of the response) with the encrypted data.</p></li>
43/// </ol>
44/// <p>To decrypt data outside of KMS:</p>
45/// <ol>
46/// <li>
47/// <p>Use the <code>Decrypt</code> operation to decrypt the encrypted data key. The operation returns a plaintext copy of the data key.</p></li>
48/// <li>
49/// <p>Use the plaintext data key to decrypt data outside of KMS, then erase the plaintext data key from memory.</p></li>
50/// </ol>
51/// <p><b>Cross-account use</b>: Yes. To perform this operation with a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN in the value of the <code>KeyId</code> parameter.</p>
52/// <p><b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:GenerateDataKey</a> (key policy)</p>
53/// <p><b>Related operations:</b></p>
54/// <ul>
55/// <li>
56/// <p><code>Decrypt</code></p></li>
57/// <li>
58/// <p><code>Encrypt</code></p></li>
59/// <li>
60/// <p><code>GenerateDataKeyPair</code></p></li>
61/// <li>
62/// <p><code>GenerateDataKeyPairWithoutPlaintext</code></p></li>
63/// <li>
64/// <p><code>GenerateDataKeyWithoutPlaintext</code></p></li>
65/// </ul>
66/// <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/programming-eventual-consistency.html">KMS eventual consistency</a>.</p>
67#[derive(::std::clone::Clone, ::std::fmt::Debug)]
68pub struct GenerateDataKeyFluentBuilder {
69 handle: ::std::sync::Arc<crate::client::Handle>,
70 inner: crate::operation::generate_data_key::builders::GenerateDataKeyInputBuilder,
71 config_override: ::std::option::Option<crate::config::Builder>,
72}
73impl
74 crate::client::customize::internal::CustomizableSend<
75 crate::operation::generate_data_key::GenerateDataKeyOutput,
76 crate::operation::generate_data_key::GenerateDataKeyError,
77 > for GenerateDataKeyFluentBuilder
78{
79 fn send(
80 self,
81 config_override: crate::config::Builder,
82 ) -> crate::client::customize::internal::BoxFuture<
83 crate::client::customize::internal::SendResult<
84 crate::operation::generate_data_key::GenerateDataKeyOutput,
85 crate::operation::generate_data_key::GenerateDataKeyError,
86 >,
87 > {
88 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
89 }
90}
91impl GenerateDataKeyFluentBuilder {
92 /// Creates a new `GenerateDataKeyFluentBuilder`.
93 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
94 Self {
95 handle,
96 inner: ::std::default::Default::default(),
97 config_override: ::std::option::Option::None,
98 }
99 }
100 /// Access the GenerateDataKey as a reference.
101 pub fn as_input(&self) -> &crate::operation::generate_data_key::builders::GenerateDataKeyInputBuilder {
102 &self.inner
103 }
104 /// Sends the request and returns the response.
105 ///
106 /// If an error occurs, an `SdkError` will be returned with additional details that
107 /// can be matched against.
108 ///
109 /// By default, any retryable failures will be retried twice. Retry behavior
110 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
111 /// set when configuring the client.
112 pub async fn send(
113 self,
114 ) -> ::std::result::Result<
115 crate::operation::generate_data_key::GenerateDataKeyOutput,
116 ::aws_smithy_runtime_api::client::result::SdkError<
117 crate::operation::generate_data_key::GenerateDataKeyError,
118 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
119 >,
120 > {
121 let input = self
122 .inner
123 .build()
124 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
125 let runtime_plugins = crate::operation::generate_data_key::GenerateDataKey::operation_runtime_plugins(
126 self.handle.runtime_plugins.clone(),
127 &self.handle.conf,
128 self.config_override,
129 );
130 crate::operation::generate_data_key::GenerateDataKey::orchestrate(&runtime_plugins, input).await
131 }
132
133 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
134 pub fn customize(
135 self,
136 ) -> crate::client::customize::CustomizableOperation<
137 crate::operation::generate_data_key::GenerateDataKeyOutput,
138 crate::operation::generate_data_key::GenerateDataKeyError,
139 Self,
140 > {
141 crate::client::customize::CustomizableOperation::new(self)
142 }
143 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
144 self.set_config_override(::std::option::Option::Some(config_override.into()));
145 self
146 }
147
148 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
149 self.config_override = config_override;
150 self
151 }
152 /// <p>Specifies the symmetric encryption KMS key that encrypts the data key. You cannot specify an asymmetric KMS key or a KMS key in a custom key store. To get the type and origin of your KMS key, use the <code>DescribeKey</code> operation.</p>
153 /// <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
154 /// <p>For example:</p>
155 /// <ul>
156 /// <li>
157 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
158 /// <li>
159 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
160 /// <li>
161 /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
162 /// <li>
163 /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
164 /// </ul>
165 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>. To get the alias name and alias ARN, use <code>ListAliases</code>.</p>
166 pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.inner = self.inner.key_id(input.into());
168 self
169 }
170 /// <p>Specifies the symmetric encryption KMS key that encrypts the data key. You cannot specify an asymmetric KMS key or a KMS key in a custom key store. To get the type and origin of your KMS key, use the <code>DescribeKey</code> operation.</p>
171 /// <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
172 /// <p>For example:</p>
173 /// <ul>
174 /// <li>
175 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
176 /// <li>
177 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
178 /// <li>
179 /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
180 /// <li>
181 /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
182 /// </ul>
183 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>. To get the alias name and alias ARN, use <code>ListAliases</code>.</p>
184 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185 self.inner = self.inner.set_key_id(input);
186 self
187 }
188 /// <p>Specifies the symmetric encryption KMS key that encrypts the data key. You cannot specify an asymmetric KMS key or a KMS key in a custom key store. To get the type and origin of your KMS key, use the <code>DescribeKey</code> operation.</p>
189 /// <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
190 /// <p>For example:</p>
191 /// <ul>
192 /// <li>
193 /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
194 /// <li>
195 /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
196 /// <li>
197 /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
198 /// <li>
199 /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
200 /// </ul>
201 /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>. To get the alias name and alias ARN, use <code>ListAliases</code>.</p>
202 pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
203 self.inner.get_key_id()
204 }
205 ///
206 /// Adds a key-value pair to `EncryptionContext`.
207 ///
208 /// To override the contents of this collection use [`set_encryption_context`](Self::set_encryption_context).
209 ///
210 /// <p>Specifies the encryption context that will be used when encrypting the data key.</p><important>
211 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
212 /// </important>
213 /// <p>An <i>encryption context</i> is a collection of non-secret key-value pairs that represent additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.</p>
214 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption context</a> in the <i>Key Management Service Developer Guide</i>.</p>
215 pub fn encryption_context(
216 mut self,
217 k: impl ::std::convert::Into<::std::string::String>,
218 v: impl ::std::convert::Into<::std::string::String>,
219 ) -> Self {
220 self.inner = self.inner.encryption_context(k.into(), v.into());
221 self
222 }
223 /// <p>Specifies the encryption context that will be used when encrypting the data key.</p><important>
224 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
225 /// </important>
226 /// <p>An <i>encryption context</i> is a collection of non-secret key-value pairs that represent additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.</p>
227 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption context</a> in the <i>Key Management Service Developer Guide</i>.</p>
228 pub fn set_encryption_context(
229 mut self,
230 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
231 ) -> Self {
232 self.inner = self.inner.set_encryption_context(input);
233 self
234 }
235 /// <p>Specifies the encryption context that will be used when encrypting the data key.</p><important>
236 /// <p>Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p>
237 /// </important>
238 /// <p>An <i>encryption context</i> is a collection of non-secret key-value pairs that represent additional authenticated data. When you use an encryption context to encrypt data, you must specify the same (an exact case-sensitive match) encryption context to decrypt the data. An encryption context is supported only on operations with symmetric encryption KMS keys. On operations with symmetric encryption KMS keys, an encryption context is optional, but it is strongly recommended.</p>
239 /// <p>For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">Encryption context</a> in the <i>Key Management Service Developer Guide</i>.</p>
240 pub fn get_encryption_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
241 self.inner.get_encryption_context()
242 }
243 /// <p>Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). For 128-bit (16-byte) and 256-bit (32-byte) data keys, use the <code>KeySpec</code> parameter.</p>
244 /// <p>You must specify either the <code>KeySpec</code> or the <code>NumberOfBytes</code> parameter (but not both) in every <code>GenerateDataKey</code> request.</p>
245 pub fn number_of_bytes(mut self, input: i32) -> Self {
246 self.inner = self.inner.number_of_bytes(input);
247 self
248 }
249 /// <p>Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). For 128-bit (16-byte) and 256-bit (32-byte) data keys, use the <code>KeySpec</code> parameter.</p>
250 /// <p>You must specify either the <code>KeySpec</code> or the <code>NumberOfBytes</code> parameter (but not both) in every <code>GenerateDataKey</code> request.</p>
251 pub fn set_number_of_bytes(mut self, input: ::std::option::Option<i32>) -> Self {
252 self.inner = self.inner.set_number_of_bytes(input);
253 self
254 }
255 /// <p>Specifies the length of the data key in bytes. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). For 128-bit (16-byte) and 256-bit (32-byte) data keys, use the <code>KeySpec</code> parameter.</p>
256 /// <p>You must specify either the <code>KeySpec</code> or the <code>NumberOfBytes</code> parameter (but not both) in every <code>GenerateDataKey</code> request.</p>
257 pub fn get_number_of_bytes(&self) -> &::std::option::Option<i32> {
258 self.inner.get_number_of_bytes()
259 }
260 /// <p>Specifies the length of the data key. Use <code>AES_128</code> to generate a 128-bit symmetric key, or <code>AES_256</code> to generate a 256-bit symmetric key.</p>
261 /// <p>You must specify either the <code>KeySpec</code> or the <code>NumberOfBytes</code> parameter (but not both) in every <code>GenerateDataKey</code> request.</p>
262 pub fn key_spec(mut self, input: crate::types::DataKeySpec) -> Self {
263 self.inner = self.inner.key_spec(input);
264 self
265 }
266 /// <p>Specifies the length of the data key. Use <code>AES_128</code> to generate a 128-bit symmetric key, or <code>AES_256</code> to generate a 256-bit symmetric key.</p>
267 /// <p>You must specify either the <code>KeySpec</code> or the <code>NumberOfBytes</code> parameter (but not both) in every <code>GenerateDataKey</code> request.</p>
268 pub fn set_key_spec(mut self, input: ::std::option::Option<crate::types::DataKeySpec>) -> Self {
269 self.inner = self.inner.set_key_spec(input);
270 self
271 }
272 /// <p>Specifies the length of the data key. Use <code>AES_128</code> to generate a 128-bit symmetric key, or <code>AES_256</code> to generate a 256-bit symmetric key.</p>
273 /// <p>You must specify either the <code>KeySpec</code> or the <code>NumberOfBytes</code> parameter (but not both) in every <code>GenerateDataKey</code> request.</p>
274 pub fn get_key_spec(&self) -> &::std::option::Option<crate::types::DataKeySpec> {
275 self.inner.get_key_spec()
276 }
277 ///
278 /// Appends an item to `GrantTokens`.
279 ///
280 /// To override the contents of this collection use [`set_grant_tokens`](Self::set_grant_tokens).
281 ///
282 /// <p>A list of grant tokens.</p>
283 /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
284 pub fn grant_tokens(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285 self.inner = self.inner.grant_tokens(input.into());
286 self
287 }
288 /// <p>A list of grant tokens.</p>
289 /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
290 pub fn set_grant_tokens(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
291 self.inner = self.inner.set_grant_tokens(input);
292 self
293 }
294 /// <p>A list of grant tokens.</p>
295 /// <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
296 pub fn get_grant_tokens(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
297 self.inner.get_grant_tokens()
298 }
299 /// <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key. The only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>.</p>
300 /// <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this parameter, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK.</p>
301 /// <p>When you use this parameter, instead of returning the plaintext data key, KMS encrypts the plaintext data key under the public key in the attestation document, and returns the resulting ciphertext in the <code>CiphertextForRecipient</code> field in the response. This ciphertext can be decrypted only with the private key in the enclave. The <code>CiphertextBlob</code> field in the response contains a copy of the data key encrypted under the KMS key specified by the <code>KeyId</code> parameter. The <code>Plaintext</code> field in the response is null or empty.</p>
302 /// <p>For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
303 pub fn recipient(mut self, input: crate::types::RecipientInfo) -> Self {
304 self.inner = self.inner.recipient(input);
305 self
306 }
307 /// <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key. The only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>.</p>
308 /// <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this parameter, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK.</p>
309 /// <p>When you use this parameter, instead of returning the plaintext data key, KMS encrypts the plaintext data key under the public key in the attestation document, and returns the resulting ciphertext in the <code>CiphertextForRecipient</code> field in the response. This ciphertext can be decrypted only with the private key in the enclave. The <code>CiphertextBlob</code> field in the response contains a copy of the data key encrypted under the KMS key specified by the <code>KeyId</code> parameter. The <code>Plaintext</code> field in the response is null or empty.</p>
310 /// <p>For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
311 pub fn set_recipient(mut self, input: ::std::option::Option<crate::types::RecipientInfo>) -> Self {
312 self.inner = self.inner.set_recipient(input);
313 self
314 }
315 /// <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key. The only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>.</p>
316 /// <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this parameter, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK.</p>
317 /// <p>When you use this parameter, instead of returning the plaintext data key, KMS encrypts the plaintext data key under the public key in the attestation document, and returns the resulting ciphertext in the <code>CiphertextForRecipient</code> field in the response. This ciphertext can be decrypted only with the private key in the enclave. The <code>CiphertextBlob</code> field in the response contains a copy of the data key encrypted under the KMS key specified by the <code>KeyId</code> parameter. The <code>Plaintext</code> field in the response is null or empty.</p>
318 /// <p>For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
319 pub fn get_recipient(&self) -> &::std::option::Option<crate::types::RecipientInfo> {
320 self.inner.get_recipient()
321 }
322 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
323 /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
324 pub fn dry_run(mut self, input: bool) -> Self {
325 self.inner = self.inner.dry_run(input);
326 self
327 }
328 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
329 /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
330 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
331 self.inner = self.inner.set_dry_run(input);
332 self
333 }
334 /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
335 /// <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
336 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
337 self.inner.get_dry_run()
338 }
339}