aws_sdk_kms/operation/derive_shared_secret/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::derive_shared_secret::_derive_shared_secret_output::DeriveSharedSecretOutputBuilder;
3
4pub use crate::operation::derive_shared_secret::_derive_shared_secret_input::DeriveSharedSecretInputBuilder;
5
6impl crate::operation::derive_shared_secret::builders::DeriveSharedSecretInputBuilder {
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::derive_shared_secret::DeriveSharedSecretOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::derive_shared_secret::DeriveSharedSecretError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.derive_shared_secret();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeriveSharedSecret`.
24///
25/// <p>Derives a shared secret using a key agreement algorithm.</p><note>
26/// <p>You must use an asymmetric NIST-recommended elliptic curve (ECC) or SM2 (China Regions only) KMS key pair with a <code>KeyUsage</code> value of <code>KEY_AGREEMENT</code> to call DeriveSharedSecret.</p>
27/// </note>
28/// <p>DeriveSharedSecret uses the <a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Ar3.pdf#page=60">Elliptic Curve Cryptography Cofactor Diffie-Hellman Primitive</a> (ECDH) to establish a key agreement between two peers by deriving a shared secret from their elliptic curve public-private key pairs. You can use the raw shared secret that DeriveSharedSecret returns to derive a symmetric key that can encrypt and decrypt data that is sent between the two peers, or that can generate and verify HMACs. KMS recommends that you follow <a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Cr2.pdf">NIST recommendations for key derivation</a> when using the raw shared secret to derive a symmetric key.</p>
29/// <p>The following workflow demonstrates how to establish key agreement over an insecure communication channel using DeriveSharedSecret.</p>
30/// <ol>
31/// <li>
32/// <p><b>Alice</b> calls <code>CreateKey</code> to create an asymmetric KMS key pair with a <code>KeyUsage</code> value of <code>KEY_AGREEMENT</code>.</p>
33/// <p>The asymmetric KMS key must use a NIST-recommended elliptic curve (ECC) or SM2 (China Regions only) key spec.</p></li>
34/// <li>
35/// <p><b>Bob</b> creates an elliptic curve key pair.</p>
36/// <p>Bob can call <code>CreateKey</code> to create an asymmetric KMS key pair or generate a key pair outside of KMS. Bob's key pair must use the same NIST-recommended elliptic curve (ECC) or SM2 (China Regions ony) curve as Alice.</p></li>
37/// <li>
38/// <p>Alice and Bob <b>exchange their public keys</b> through an insecure communication channel (like the internet).</p>
39/// <p>Use <code>GetPublicKey</code> to download the public key of your asymmetric KMS key pair.</p><note>
40/// <p>KMS strongly recommends verifying that the public key you receive came from the expected party before using it to derive a shared secret.</p>
41/// </note></li>
42/// <li>
43/// <p><b>Alice</b> calls DeriveSharedSecret.</p>
44/// <p>KMS uses the private key from the KMS key pair generated in <b>Step 1</b>, Bob's public key, and the Elliptic Curve Cryptography Cofactor Diffie-Hellman Primitive to derive the shared secret. The private key in your KMS key pair never leaves KMS unencrypted. DeriveSharedSecret returns the raw shared secret.</p></li>
45/// <li>
46/// <p><b>Bob</b> uses the Elliptic Curve Cryptography Cofactor Diffie-Hellman Primitive to calculate the same raw secret using his private key and Alice's public key.</p></li>
47/// </ol>
48/// <p>To derive a shared secret you must provide a key agreement algorithm, the private key of the caller's asymmetric NIST-recommended elliptic curve or SM2 (China Regions only) KMS key pair, and the public key from your peer's NIST-recommended elliptic curve or SM2 (China Regions only) key pair. The public key can be from another asymmetric KMS key pair or from a key pair generated outside of KMS, but both key pairs must be on the same elliptic curve.</p>
49/// <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>
50/// <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>
51/// <p><b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:DeriveSharedSecret</a> (key policy)</p>
52/// <p><b>Related operations:</b></p>
53/// <ul>
54/// <li>
55/// <p><code>CreateKey</code></p></li>
56/// <li>
57/// <p><code>GetPublicKey</code></p></li>
58/// <li>
59/// <p><code>DescribeKey</code></p></li>
60/// </ul>
61/// <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>
62#[derive(::std::clone::Clone, ::std::fmt::Debug)]
63pub struct DeriveSharedSecretFluentBuilder {
64    handle: ::std::sync::Arc<crate::client::Handle>,
65    inner: crate::operation::derive_shared_secret::builders::DeriveSharedSecretInputBuilder,
66    config_override: ::std::option::Option<crate::config::Builder>,
67}
68impl
69    crate::client::customize::internal::CustomizableSend<
70        crate::operation::derive_shared_secret::DeriveSharedSecretOutput,
71        crate::operation::derive_shared_secret::DeriveSharedSecretError,
72    > for DeriveSharedSecretFluentBuilder
73{
74    fn send(
75        self,
76        config_override: crate::config::Builder,
77    ) -> crate::client::customize::internal::BoxFuture<
78        crate::client::customize::internal::SendResult<
79            crate::operation::derive_shared_secret::DeriveSharedSecretOutput,
80            crate::operation::derive_shared_secret::DeriveSharedSecretError,
81        >,
82    > {
83        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
84    }
85}
86impl DeriveSharedSecretFluentBuilder {
87    /// Creates a new `DeriveSharedSecretFluentBuilder`.
88    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
89        Self {
90            handle,
91            inner: ::std::default::Default::default(),
92            config_override: ::std::option::Option::None,
93        }
94    }
95    /// Access the DeriveSharedSecret as a reference.
96    pub fn as_input(&self) -> &crate::operation::derive_shared_secret::builders::DeriveSharedSecretInputBuilder {
97        &self.inner
98    }
99    /// Sends the request and returns the response.
100    ///
101    /// If an error occurs, an `SdkError` will be returned with additional details that
102    /// can be matched against.
103    ///
104    /// By default, any retryable failures will be retried twice. Retry behavior
105    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
106    /// set when configuring the client.
107    pub async fn send(
108        self,
109    ) -> ::std::result::Result<
110        crate::operation::derive_shared_secret::DeriveSharedSecretOutput,
111        ::aws_smithy_runtime_api::client::result::SdkError<
112            crate::operation::derive_shared_secret::DeriveSharedSecretError,
113            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
114        >,
115    > {
116        let input = self
117            .inner
118            .build()
119            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
120        let runtime_plugins = crate::operation::derive_shared_secret::DeriveSharedSecret::operation_runtime_plugins(
121            self.handle.runtime_plugins.clone(),
122            &self.handle.conf,
123            self.config_override,
124        );
125        crate::operation::derive_shared_secret::DeriveSharedSecret::orchestrate(&runtime_plugins, input).await
126    }
127
128    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
129    pub fn customize(
130        self,
131    ) -> crate::client::customize::CustomizableOperation<
132        crate::operation::derive_shared_secret::DeriveSharedSecretOutput,
133        crate::operation::derive_shared_secret::DeriveSharedSecretError,
134        Self,
135    > {
136        crate::client::customize::CustomizableOperation::new(self)
137    }
138    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
139        self.set_config_override(::std::option::Option::Some(config_override.into()));
140        self
141    }
142
143    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
144        self.config_override = config_override;
145        self
146    }
147    /// <p>Identifies an asymmetric NIST-recommended ECC or SM2 (China Regions only) KMS key. KMS uses the private key in the specified key pair to derive the shared secret. The key usage of the KMS key must be <code>KEY_AGREEMENT</code>. To find the <code>KeyUsage</code> of a KMS key, use the <code>DescribeKey</code> operation.</p>
148    /// <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>
149    /// <p>For example:</p>
150    /// <ul>
151    /// <li>
152    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
153    /// <li>
154    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
155    /// <li>
156    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
157    /// <li>
158    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
159    /// </ul>
160    /// <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>
161    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.key_id(input.into());
163        self
164    }
165    /// <p>Identifies an asymmetric NIST-recommended ECC or SM2 (China Regions only) KMS key. KMS uses the private key in the specified key pair to derive the shared secret. The key usage of the KMS key must be <code>KEY_AGREEMENT</code>. To find the <code>KeyUsage</code> of a KMS key, use the <code>DescribeKey</code> operation.</p>
166    /// <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>
167    /// <p>For example:</p>
168    /// <ul>
169    /// <li>
170    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
171    /// <li>
172    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
173    /// <li>
174    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
175    /// <li>
176    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
177    /// </ul>
178    /// <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>
179    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.inner = self.inner.set_key_id(input);
181        self
182    }
183    /// <p>Identifies an asymmetric NIST-recommended ECC or SM2 (China Regions only) KMS key. KMS uses the private key in the specified key pair to derive the shared secret. The key usage of the KMS key must be <code>KEY_AGREEMENT</code>. To find the <code>KeyUsage</code> of a KMS key, use the <code>DescribeKey</code> operation.</p>
184    /// <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>
185    /// <p>For example:</p>
186    /// <ul>
187    /// <li>
188    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
189    /// <li>
190    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
191    /// <li>
192    /// <p>Alias name: <code>alias/ExampleAlias</code></p></li>
193    /// <li>
194    /// <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code></p></li>
195    /// </ul>
196    /// <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>
197    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
198        self.inner.get_key_id()
199    }
200    /// <p>Specifies the key agreement algorithm used to derive the shared secret. The only valid value is <code>ECDH</code>.</p>
201    pub fn key_agreement_algorithm(mut self, input: crate::types::KeyAgreementAlgorithmSpec) -> Self {
202        self.inner = self.inner.key_agreement_algorithm(input);
203        self
204    }
205    /// <p>Specifies the key agreement algorithm used to derive the shared secret. The only valid value is <code>ECDH</code>.</p>
206    pub fn set_key_agreement_algorithm(mut self, input: ::std::option::Option<crate::types::KeyAgreementAlgorithmSpec>) -> Self {
207        self.inner = self.inner.set_key_agreement_algorithm(input);
208        self
209    }
210    /// <p>Specifies the key agreement algorithm used to derive the shared secret. The only valid value is <code>ECDH</code>.</p>
211    pub fn get_key_agreement_algorithm(&self) -> &::std::option::Option<crate::types::KeyAgreementAlgorithmSpec> {
212        self.inner.get_key_agreement_algorithm()
213    }
214    /// <p>Specifies the public key in your peer's NIST-recommended elliptic curve (ECC) or SM2 (China Regions only) key pair.</p>
215    /// <p>The public key must be a DER-encoded X.509 public key, also known as <code>SubjectPublicKeyInfo</code> (SPKI), as defined in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>.</p>
216    /// <p><code>GetPublicKey</code> returns the public key of an asymmetric KMS key pair in the required DER-encoded format.</p><note>
217    /// <p>If you use <a href="https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-welcome.html">Amazon Web Services CLI version 1</a>, you must provide the DER-encoded X.509 public key in a file. Otherwise, the Amazon Web Services CLI Base64-encodes the public key a second time, resulting in a <code>ValidationException</code>.</p>
218    /// </note>
219    /// <p>You can specify the public key as binary data in a file using fileb (<code>fileb://<path-to-file></path-to-file></code>) or in-line using a Base64 encoded string.</p>
220    pub fn public_key(mut self, input: ::aws_smithy_types::Blob) -> Self {
221        self.inner = self.inner.public_key(input);
222        self
223    }
224    /// <p>Specifies the public key in your peer's NIST-recommended elliptic curve (ECC) or SM2 (China Regions only) key pair.</p>
225    /// <p>The public key must be a DER-encoded X.509 public key, also known as <code>SubjectPublicKeyInfo</code> (SPKI), as defined in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>.</p>
226    /// <p><code>GetPublicKey</code> returns the public key of an asymmetric KMS key pair in the required DER-encoded format.</p><note>
227    /// <p>If you use <a href="https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-welcome.html">Amazon Web Services CLI version 1</a>, you must provide the DER-encoded X.509 public key in a file. Otherwise, the Amazon Web Services CLI Base64-encodes the public key a second time, resulting in a <code>ValidationException</code>.</p>
228    /// </note>
229    /// <p>You can specify the public key as binary data in a file using fileb (<code>fileb://<path-to-file></path-to-file></code>) or in-line using a Base64 encoded string.</p>
230    pub fn set_public_key(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
231        self.inner = self.inner.set_public_key(input);
232        self
233    }
234    /// <p>Specifies the public key in your peer's NIST-recommended elliptic curve (ECC) or SM2 (China Regions only) key pair.</p>
235    /// <p>The public key must be a DER-encoded X.509 public key, also known as <code>SubjectPublicKeyInfo</code> (SPKI), as defined in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>.</p>
236    /// <p><code>GetPublicKey</code> returns the public key of an asymmetric KMS key pair in the required DER-encoded format.</p><note>
237    /// <p>If you use <a href="https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-welcome.html">Amazon Web Services CLI version 1</a>, you must provide the DER-encoded X.509 public key in a file. Otherwise, the Amazon Web Services CLI Base64-encodes the public key a second time, resulting in a <code>ValidationException</code>.</p>
238    /// </note>
239    /// <p>You can specify the public key as binary data in a file using fileb (<code>fileb://<path-to-file></path-to-file></code>) or in-line using a Base64 encoded string.</p>
240    pub fn get_public_key(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
241        self.inner.get_public_key()
242    }
243    ///
244    /// Appends an item to `GrantTokens`.
245    ///
246    /// To override the contents of this collection use [`set_grant_tokens`](Self::set_grant_tokens).
247    ///
248    /// <p>A list of grant tokens.</p>
249    /// <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>
250    pub fn grant_tokens(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
251        self.inner = self.inner.grant_tokens(input.into());
252        self
253    }
254    /// <p>A list of grant tokens.</p>
255    /// <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>
256    pub fn set_grant_tokens(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
257        self.inner = self.inner.set_grant_tokens(input);
258        self
259    }
260    /// <p>A list of grant tokens.</p>
261    /// <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>
262    pub fn get_grant_tokens(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
263        self.inner.get_grant_tokens()
264    }
265    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
266    /// <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>
267    pub fn dry_run(mut self, input: bool) -> Self {
268        self.inner = self.inner.dry_run(input);
269        self
270    }
271    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
272    /// <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>
273    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
274        self.inner = self.inner.set_dry_run(input);
275        self
276    }
277    /// <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter.</p>
278    /// <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>
279    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
280        self.inner.get_dry_run()
281    }
282    /// <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>
283    /// <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To call DeriveSharedSecret for an Amazon Web Services Nitro Enclaves, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> to generate the attestation document and then use the Recipient parameter from any Amazon Web Services SDK to provide the attestation document for the enclave.</p>
284    /// <p>When you use this parameter, instead of returning a plaintext copy of the shared secret, KMS encrypts the plaintext shared secret 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 the encrypted shared secret derived from the KMS key specified by the <code>KeyId</code> parameter and public key specified by the <code>PublicKey</code> parameter. The <code>SharedSecret</code> field in the response is null or empty.</p>
285    /// <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>
286    pub fn recipient(mut self, input: crate::types::RecipientInfo) -> Self {
287        self.inner = self.inner.recipient(input);
288        self
289    }
290    /// <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>
291    /// <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To call DeriveSharedSecret for an Amazon Web Services Nitro Enclaves, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> to generate the attestation document and then use the Recipient parameter from any Amazon Web Services SDK to provide the attestation document for the enclave.</p>
292    /// <p>When you use this parameter, instead of returning a plaintext copy of the shared secret, KMS encrypts the plaintext shared secret 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 the encrypted shared secret derived from the KMS key specified by the <code>KeyId</code> parameter and public key specified by the <code>PublicKey</code> parameter. The <code>SharedSecret</code> field in the response is null or empty.</p>
293    /// <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>
294    pub fn set_recipient(mut self, input: ::std::option::Option<crate::types::RecipientInfo>) -> Self {
295        self.inner = self.inner.set_recipient(input);
296        self
297    }
298    /// <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>
299    /// <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To call DeriveSharedSecret for an Amazon Web Services Nitro Enclaves, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> to generate the attestation document and then use the Recipient parameter from any Amazon Web Services SDK to provide the attestation document for the enclave.</p>
300    /// <p>When you use this parameter, instead of returning a plaintext copy of the shared secret, KMS encrypts the plaintext shared secret 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 the encrypted shared secret derived from the KMS key specified by the <code>KeyId</code> parameter and public key specified by the <code>PublicKey</code> parameter. The <code>SharedSecret</code> field in the response is null or empty.</p>
301    /// <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>
302    pub fn get_recipient(&self) -> &::std::option::Option<crate::types::RecipientInfo> {
303        self.inner.get_recipient()
304    }
305}