aws_sdk_kms/operation/decrypt/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::decrypt::_decrypt_output::DecryptOutputBuilder;
3
4pub use crate::operation::decrypt::_decrypt_input::DecryptInputBuilder;
5
6impl crate::operation::decrypt::builders::DecryptInputBuilder {
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::decrypt::DecryptOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::decrypt::DecryptError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.decrypt();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `Decrypt`.
24///
25/// <p>Decrypts ciphertext that was encrypted by a KMS key using any of the following operations:</p>
26/// <ul>
27/// <li>
28/// <p><code>Encrypt</code></p></li>
29/// <li>
30/// <p><code>GenerateDataKey</code></p></li>
31/// <li>
32/// <p><code>GenerateDataKeyPair</code></p></li>
33/// <li>
34/// <p><code>GenerateDataKeyWithoutPlaintext</code></p></li>
35/// <li>
36/// <p><code>GenerateDataKeyPairWithoutPlaintext</code></p></li>
37/// </ul>
38/// <p>You can use this operation to decrypt ciphertext that was encrypted under a symmetric encryption KMS key or an asymmetric encryption KMS key. When the KMS key is asymmetric, you must specify the KMS key and the encryption algorithm that was used to encrypt the ciphertext. For information about asymmetric KMS keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Asymmetric KMS keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
39/// <p>The <code>Decrypt</code> operation also decrypts ciphertext that was encrypted outside of KMS by the public key in an KMS asymmetric KMS key. However, it cannot decrypt symmetric ciphertext produced by other libraries, such as the <a href="https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/">Amazon Web Services Encryption SDK</a> or <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html">Amazon S3 client-side encryption</a>. These libraries return a ciphertext format that is incompatible with KMS.</p>
40/// <p>If the ciphertext was encrypted under a symmetric encryption KMS key, the <code>KeyId</code> parameter is optional. KMS can get this information from metadata that it adds to the symmetric ciphertext blob. This feature adds durability to your implementation by ensuring that authorized users can decrypt ciphertext decades after it was encrypted, even if they've lost track of the key ID. However, specifying the KMS key is always recommended as a best practice. When you use the <code>KeyId</code> parameter to specify a KMS key, KMS only uses the KMS key you specify. If the ciphertext was encrypted under a different KMS key, the <code>Decrypt</code> operation fails. This practice ensures that you use the KMS key that you intend.</p>
41/// <p>Whenever possible, use key policies to give users permission to call the <code>Decrypt</code> operation on a particular KMS key, instead of using &amp;IAM; policies. Otherwise, you might create an &amp;IAM; policy that gives the user <code>Decrypt</code> permission on all KMS keys. This user could decrypt ciphertext that was encrypted by KMS keys in other accounts if the key policy for the cross-account KMS key permits it. If you must use an IAM policy for <code>Decrypt</code> permissions, limit the user to particular KMS keys or 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 policies</a> in the <i>Key Management Service Developer Guide</i>.</p>
42/// <p><code>Decrypt</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>Decrypt</code> for a 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. Instead of the plaintext data, the response includes the plaintext data encrypted with 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>
43/// <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>
44/// <p><b>Cross-account use</b>: Yes. If you use the <code>KeyId</code> parameter to identify a KMS key in a different Amazon Web Services account, specify the key ARN or the alias ARN of the KMS key.</p>
45/// <p><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>
46/// <p><b>Related operations:</b></p>
47/// <ul>
48/// <li>
49/// <p><code>Encrypt</code></p></li>
50/// <li>
51/// <p><code>GenerateDataKey</code></p></li>
52/// <li>
53/// <p><code>GenerateDataKeyPair</code></p></li>
54/// <li>
55/// <p><code>ReEncrypt</code></p></li>
56/// </ul>
57/// <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>
58#[derive(::std::clone::Clone, ::std::fmt::Debug)]
59pub struct DecryptFluentBuilder {
60    handle: ::std::sync::Arc<crate::client::Handle>,
61    inner: crate::operation::decrypt::builders::DecryptInputBuilder,
62    config_override: ::std::option::Option<crate::config::Builder>,
63}
64impl crate::client::customize::internal::CustomizableSend<crate::operation::decrypt::DecryptOutput, crate::operation::decrypt::DecryptError>
65    for DecryptFluentBuilder
66{
67    fn send(
68        self,
69        config_override: crate::config::Builder,
70    ) -> crate::client::customize::internal::BoxFuture<
71        crate::client::customize::internal::SendResult<crate::operation::decrypt::DecryptOutput, crate::operation::decrypt::DecryptError>,
72    > {
73        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
74    }
75}
76impl DecryptFluentBuilder {
77    /// Creates a new `DecryptFluentBuilder`.
78    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
79        Self {
80            handle,
81            inner: ::std::default::Default::default(),
82            config_override: ::std::option::Option::None,
83        }
84    }
85    /// Access the Decrypt as a reference.
86    pub fn as_input(&self) -> &crate::operation::decrypt::builders::DecryptInputBuilder {
87        &self.inner
88    }
89    /// Sends the request and returns the response.
90    ///
91    /// If an error occurs, an `SdkError` will be returned with additional details that
92    /// can be matched against.
93    ///
94    /// By default, any retryable failures will be retried twice. Retry behavior
95    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
96    /// set when configuring the client.
97    pub async fn send(
98        self,
99    ) -> ::std::result::Result<
100        crate::operation::decrypt::DecryptOutput,
101        ::aws_smithy_runtime_api::client::result::SdkError<
102            crate::operation::decrypt::DecryptError,
103            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
104        >,
105    > {
106        let input = self
107            .inner
108            .build()
109            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
110        let runtime_plugins = crate::operation::decrypt::Decrypt::operation_runtime_plugins(
111            self.handle.runtime_plugins.clone(),
112            &self.handle.conf,
113            self.config_override,
114        );
115        crate::operation::decrypt::Decrypt::orchestrate(&runtime_plugins, input).await
116    }
117
118    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
119    pub fn customize(
120        self,
121    ) -> crate::client::customize::CustomizableOperation<crate::operation::decrypt::DecryptOutput, crate::operation::decrypt::DecryptError, Self>
122    {
123        crate::client::customize::CustomizableOperation::new(self)
124    }
125    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
126        self.set_config_override(::std::option::Option::Some(config_override.into()));
127        self
128    }
129
130    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
131        self.config_override = config_override;
132        self
133    }
134    /// <p>Ciphertext to be decrypted. The blob includes metadata.</p>
135    pub fn ciphertext_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
136        self.inner = self.inner.ciphertext_blob(input);
137        self
138    }
139    /// <p>Ciphertext to be decrypted. The blob includes metadata.</p>
140    pub fn set_ciphertext_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
141        self.inner = self.inner.set_ciphertext_blob(input);
142        self
143    }
144    /// <p>Ciphertext to be decrypted. The blob includes metadata.</p>
145    pub fn get_ciphertext_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
146        self.inner.get_ciphertext_blob()
147    }
148    ///
149    /// Adds a key-value pair to `EncryptionContext`.
150    ///
151    /// To override the contents of this collection use [`set_encryption_context`](Self::set_encryption_context).
152    ///
153    /// <p>Specifies the encryption context to use when decrypting the data. An encryption context is valid only for <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic operations</a> with a symmetric encryption KMS key. The standard asymmetric encryption algorithms and HMAC algorithms that KMS uses do not support an encryption context.</p>
154    /// <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>
155    /// <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>
156    pub fn encryption_context(
157        mut self,
158        k: impl ::std::convert::Into<::std::string::String>,
159        v: impl ::std::convert::Into<::std::string::String>,
160    ) -> Self {
161        self.inner = self.inner.encryption_context(k.into(), v.into());
162        self
163    }
164    /// <p>Specifies the encryption context to use when decrypting the data. An encryption context is valid only for <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic operations</a> with a symmetric encryption KMS key. The standard asymmetric encryption algorithms and HMAC algorithms that KMS uses do not support an encryption context.</p>
165    /// <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>
166    /// <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>
167    pub fn set_encryption_context(
168        mut self,
169        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
170    ) -> Self {
171        self.inner = self.inner.set_encryption_context(input);
172        self
173    }
174    /// <p>Specifies the encryption context to use when decrypting the data. An encryption context is valid only for <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic operations</a> with a symmetric encryption KMS key. The standard asymmetric encryption algorithms and HMAC algorithms that KMS uses do not support an encryption context.</p>
175    /// <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>
176    /// <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>
177    pub fn get_encryption_context(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
178        self.inner.get_encryption_context()
179    }
180    ///
181    /// Appends an item to `GrantTokens`.
182    ///
183    /// To override the contents of this collection use [`set_grant_tokens`](Self::set_grant_tokens).
184    ///
185    /// <p>A list of grant tokens.</p>
186    /// <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>
187    pub fn grant_tokens(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.inner = self.inner.grant_tokens(input.into());
189        self
190    }
191    /// <p>A list of grant tokens.</p>
192    /// <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>
193    pub fn set_grant_tokens(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
194        self.inner = self.inner.set_grant_tokens(input);
195        self
196    }
197    /// <p>A list of grant tokens.</p>
198    /// <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>
199    pub fn get_grant_tokens(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
200        self.inner.get_grant_tokens()
201    }
202    /// <p>Specifies the KMS key that KMS uses to decrypt the ciphertext.</p>
203    /// <p>Enter a key ID of the KMS key that was used to encrypt the ciphertext. If you identify a different KMS key, the <code>Decrypt</code> operation throws an <code>IncorrectKeyException</code>.</p>
204    /// <p>This parameter is required only when the ciphertext was encrypted under an asymmetric KMS key. If you used a symmetric encryption KMS key, KMS can get the KMS key from metadata that it adds to the symmetric ciphertext blob. However, it is always recommended as a best practice. This practice ensures that you use the KMS key that you intend.</p>
205    /// <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>
206    /// <p>For example:</p>
207    /// <ul>
208    /// <li>
209    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
210    /// <li>
211    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
212    /// <li>
213    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
214    /// <li>
215    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
216    /// </ul>
217    /// <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>
218    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219        self.inner = self.inner.key_id(input.into());
220        self
221    }
222    /// <p>Specifies the KMS key that KMS uses to decrypt the ciphertext.</p>
223    /// <p>Enter a key ID of the KMS key that was used to encrypt the ciphertext. If you identify a different KMS key, the <code>Decrypt</code> operation throws an <code>IncorrectKeyException</code>.</p>
224    /// <p>This parameter is required only when the ciphertext was encrypted under an asymmetric KMS key. If you used a symmetric encryption KMS key, KMS can get the KMS key from metadata that it adds to the symmetric ciphertext blob. However, it is always recommended as a best practice. This practice ensures that you use the KMS key that you intend.</p>
225    /// <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>
226    /// <p>For example:</p>
227    /// <ul>
228    /// <li>
229    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
230    /// <li>
231    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
232    /// <li>
233    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
234    /// <li>
235    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
236    /// </ul>
237    /// <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>
238    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
239        self.inner = self.inner.set_key_id(input);
240        self
241    }
242    /// <p>Specifies the KMS key that KMS uses to decrypt the ciphertext.</p>
243    /// <p>Enter a key ID of the KMS key that was used to encrypt the ciphertext. If you identify a different KMS key, the <code>Decrypt</code> operation throws an <code>IncorrectKeyException</code>.</p>
244    /// <p>This parameter is required only when the ciphertext was encrypted under an asymmetric KMS key. If you used a symmetric encryption KMS key, KMS can get the KMS key from metadata that it adds to the symmetric ciphertext blob. However, it is always recommended as a best practice. This practice ensures that you use the KMS key that you intend.</p>
245    /// <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>
246    /// <p>For example:</p>
247    /// <ul>
248    /// <li>
249    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
250    /// <li>
251    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
252    /// <li>
253    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
254    /// <li>
255    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
256    /// </ul>
257    /// <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>
258    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
259        self.inner.get_key_id()
260    }
261    /// <p>Specifies the encryption algorithm that will be used to decrypt the ciphertext. Specify the same algorithm that was used to encrypt the data. If you specify a different algorithm, the <code>Decrypt</code> operation fails.</p>
262    /// <p>This parameter is required only when the ciphertext was encrypted under an asymmetric KMS key. The default value, <code>SYMMETRIC_DEFAULT</code>, represents the only supported algorithm that is valid for symmetric encryption KMS keys.</p>
263    pub fn encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
264        self.inner = self.inner.encryption_algorithm(input);
265        self
266    }
267    /// <p>Specifies the encryption algorithm that will be used to decrypt the ciphertext. Specify the same algorithm that was used to encrypt the data. If you specify a different algorithm, the <code>Decrypt</code> operation fails.</p>
268    /// <p>This parameter is required only when the ciphertext was encrypted under an asymmetric KMS key. The default value, <code>SYMMETRIC_DEFAULT</code>, represents the only supported algorithm that is valid for symmetric encryption KMS keys.</p>
269    pub fn set_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
270        self.inner = self.inner.set_encryption_algorithm(input);
271        self
272    }
273    /// <p>Specifies the encryption algorithm that will be used to decrypt the ciphertext. Specify the same algorithm that was used to encrypt the data. If you specify a different algorithm, the <code>Decrypt</code> operation fails.</p>
274    /// <p>This parameter is required only when the ciphertext was encrypted under an asymmetric KMS key. The default value, <code>SYMMETRIC_DEFAULT</code>, represents the only supported algorithm that is valid for symmetric encryption KMS keys.</p>
275    pub fn get_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
276        self.inner.get_encryption_algorithm()
277    }
278    /// <p>A signed <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-concepts.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>
279    /// <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>
280    /// <p>When you use this parameter, instead of returning the plaintext data, KMS encrypts the plaintext data with 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>Plaintext</code> field in the response is null or empty.</p>
281    /// <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>
282    pub fn recipient(mut self, input: crate::types::RecipientInfo) -> Self {
283        self.inner = self.inner.recipient(input);
284        self
285    }
286    /// <p>A signed <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-concepts.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>
287    /// <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>
288    /// <p>When you use this parameter, instead of returning the plaintext data, KMS encrypts the plaintext data with 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>Plaintext</code> field in the response is null or empty.</p>
289    /// <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>
290    pub fn set_recipient(mut self, input: ::std::option::Option<crate::types::RecipientInfo>) -> Self {
291        self.inner = self.inner.set_recipient(input);
292        self
293    }
294    /// <p>A signed <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-concepts.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>
295    /// <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>
296    /// <p>When you use this parameter, instead of returning the plaintext data, KMS encrypts the plaintext data with 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>Plaintext</code> field in the response is null or empty.</p>
297    /// <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>
298    pub fn get_recipient(&self) -> &::std::option::Option<crate::types::RecipientInfo> {
299        self.inner.get_recipient()
300    }
301    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
302    /// <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>
303    pub fn dry_run(mut self, input: bool) -> Self {
304        self.inner = self.inner.dry_run(input);
305        self
306    }
307    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
308    /// <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>
309    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
310        self.inner = self.inner.set_dry_run(input);
311        self
312    }
313    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
314    /// <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>
315    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
316        self.inner.get_dry_run()
317    }
318}