pub struct EncapsulateFluentBuilder { /* private fields */ }Expand description
Fluent builder constructing a request to Encapsulate.
Generates a shared secret and its encapsulated (ciphertext) form using the public key of an ML-KEM KMS key pair. Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM), specified in FIPS 203 on the NIST website, is a post-quantum algorithm for establishing a shared secret between two parties.
For an example of how two parties establish a shared secret over an insecure channel using ML-KEM, see ML-KEM keys in KMS in the Key Management Service Developer Guide.
The Encapsulate operation is not available in China Regions.
The KMS key that you use for this operation must be in a compatible key state. For details, see Key states of KMS keys in the Key Management Service Developer Guide.
Cross-account use: 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 KeyId parameter.
Required permissions: kms:Encapsulate (key policy)
Related operations:
-
Decapsulate -
DeriveSharedSecret -
CreateKey -
GetPublicKey -
DescribeKey
Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
Implementations§
Source§impl EncapsulateFluentBuilder
impl EncapsulateFluentBuilder
Sourcepub fn as_input(&self) -> &EncapsulateInputBuilder
pub fn as_input(&self) -> &EncapsulateInputBuilder
Access the Encapsulate as a reference.
Sourcepub async fn send(
self,
) -> Result<EncapsulateOutput, SdkError<EncapsulateError, HttpResponse>>
pub async fn send( self, ) -> Result<EncapsulateOutput, SdkError<EncapsulateError, HttpResponse>>
Sends the request and returns the response.
If an error occurs, an SdkError will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
Sourcepub fn customize(
self,
) -> CustomizableOperation<EncapsulateOutput, EncapsulateError, Self>
pub fn customize( self, ) -> CustomizableOperation<EncapsulateOutput, EncapsulateError, Self>
Consumes this builder, creating a customizable operation that can be modified before being sent.
Sourcepub fn key_id(self, input: impl Into<String>) -> Self
pub fn key_id(self, input: impl Into<String>) -> Self
Identifies an asymmetric ML-KEM KMS key. KMS uses the public key in the specified key pair to encapsulate the shared secret. ML-KEM KMS keys have a KeySpec value of ML_KEM_512, ML_KEM_768, or ML_KEM_1024 and a KeyUsage value of ENCAPSULATE_DECAPSULATE. To find the KeySpec and KeyUsage of a KMS key, use the DescribeKey operation.
To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with "alias/". To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab -
Alias name:
alias/ExampleAlias -
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases.
Sourcepub fn set_key_id(self, input: Option<String>) -> Self
pub fn set_key_id(self, input: Option<String>) -> Self
Identifies an asymmetric ML-KEM KMS key. KMS uses the public key in the specified key pair to encapsulate the shared secret. ML-KEM KMS keys have a KeySpec value of ML_KEM_512, ML_KEM_768, or ML_KEM_1024 and a KeyUsage value of ENCAPSULATE_DECAPSULATE. To find the KeySpec and KeyUsage of a KMS key, use the DescribeKey operation.
To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with "alias/". To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab -
Alias name:
alias/ExampleAlias -
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases.
Sourcepub fn get_key_id(&self) -> &Option<String>
pub fn get_key_id(&self) -> &Option<String>
Identifies an asymmetric ML-KEM KMS key. KMS uses the public key in the specified key pair to encapsulate the shared secret. ML-KEM KMS keys have a KeySpec value of ML_KEM_512, ML_KEM_768, or ML_KEM_1024 and a KeyUsage value of ENCAPSULATE_DECAPSULATE. To find the KeySpec and KeyUsage of a KMS key, use the DescribeKey operation.
To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with "alias/". To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab -
Alias name:
alias/ExampleAlias -
Alias ARN:
arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey. To get the alias name and alias ARN, use ListAliases.
Sourcepub fn encapsulation_algorithm(self, input: EncapsulationAlgorithmSpec) -> Self
pub fn encapsulation_algorithm(self, input: EncapsulationAlgorithmSpec) -> Self
Specifies the key encapsulation algorithm used to generate the shared secret and its encapsulated form. The only valid value is ML_KEM.
Sourcepub fn set_encapsulation_algorithm(
self,
input: Option<EncapsulationAlgorithmSpec>,
) -> Self
pub fn set_encapsulation_algorithm( self, input: Option<EncapsulationAlgorithmSpec>, ) -> Self
Specifies the key encapsulation algorithm used to generate the shared secret and its encapsulated form. The only valid value is ML_KEM.
Sourcepub fn get_encapsulation_algorithm(&self) -> &Option<EncapsulationAlgorithmSpec>
pub fn get_encapsulation_algorithm(&self) -> &Option<EncapsulationAlgorithmSpec>
Specifies the key encapsulation algorithm used to generate the shared secret and its encapsulated form. The only valid value is ML_KEM.
Sourcepub fn grant_tokens(self, input: impl Into<String>) -> Self
pub fn grant_tokens(self, input: impl Into<String>) -> Self
Appends an item to GrantTokens.
To override the contents of this collection use set_grant_tokens.
A list of grant tokens.
Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved eventual consistency. For more information, see Grant token and Using a grant token in the Key Management Service Developer Guide.
Sourcepub fn set_grant_tokens(self, input: Option<Vec<String>>) -> Self
pub fn set_grant_tokens(self, input: Option<Vec<String>>) -> Self
A list of grant tokens.
Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved eventual consistency. For more information, see Grant token and Using a grant token in the Key Management Service Developer Guide.
Sourcepub fn get_grant_tokens(&self) -> &Option<Vec<String>>
pub fn get_grant_tokens(&self) -> &Option<Vec<String>>
A list of grant tokens.
Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved eventual consistency. For more information, see Grant token and Using a grant token in the Key Management Service Developer Guide.
Sourcepub fn dry_run(self, input: bool) -> Self
pub fn dry_run(self, input: bool) -> Self
Checks if your request will succeed. DryRun is an optional parameter.
To learn more about how to use this parameter, see Testing your permissions in the Key Management Service Developer Guide.
Sourcepub fn set_dry_run(self, input: Option<bool>) -> Self
pub fn set_dry_run(self, input: Option<bool>) -> Self
Checks if your request will succeed. DryRun is an optional parameter.
To learn more about how to use this parameter, see Testing your permissions in the Key Management Service Developer Guide.
Sourcepub fn get_dry_run(&self) -> &Option<bool>
pub fn get_dry_run(&self) -> &Option<bool>
Checks if your request will succeed. DryRun is an optional parameter.
To learn more about how to use this parameter, see Testing your permissions in the Key Management Service Developer Guide.
Trait Implementations§
Source§impl Clone for EncapsulateFluentBuilder
impl Clone for EncapsulateFluentBuilder
Source§fn clone(&self) -> EncapsulateFluentBuilder
fn clone(&self) -> EncapsulateFluentBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for EncapsulateFluentBuilder
impl !UnwindSafe for EncapsulateFluentBuilder
impl Freeze for EncapsulateFluentBuilder
impl Send for EncapsulateFluentBuilder
impl Sync for EncapsulateFluentBuilder
impl Unpin for EncapsulateFluentBuilder
impl UnsafeUnpin for EncapsulateFluentBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more