Skip to content

KMSClient.decapsulate

rboto-kms==0.4.0 · Service index · Types

Model summary (excerpt): Recovers the shared secret that was encapsulated with the public key of an ML-KEM KMS key. 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...

Install and imports

python -m pip install "rboto[kms]==0.4.0"
from rboto import KMSClient
from collections.abc import Sequence
from rboto_kms.types import (
    DecapsulateOutput,
    EncapsulationAlgorithmSpec,
)

Signature

async def decapsulate(
    *,
    key_id: str,
    shared_secret_ciphertext_blob: bytes,
    encapsulation_algorithm: EncapsulationAlgorithmSpec,
    grant_tokens: Sequence[str] | None = None,
    dry_run: bool | None = None,
) -> DecapsulateOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
key_id Yes Identifies the asymmetric ML-KEM KMS key whose public key was used to produce the encapsulated shared secret. KMS uses the private key in the specified key pair to decapsulate the shared secret. 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...
shared_secret_ciphertext_blob Yes The encapsulated (ciphertext) form of the shared secret to recover. This is the SharedSecretCiphertextBlob value that the Encapsulate operation returns. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.
encapsulation_algorithm Yes Specifies the key encapsulation algorithm used to recover the shared secret. The only valid value is ML_KEM .
grant_tokens No 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 .
dry_run No 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 .

Output

DecapsulateOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
key_id str | None Always present —
shared_secret bytes | None Always present —
encapsulation_algorithm EncapsulationAlgorithmSpecOutput | None Always present EncapsulationAlgorithmSpecOutput

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

DecapsulateOutput, EncapsulationAlgorithmSpec

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_kms.exceptions:

DependencyTimeoutError, DisabledError, DryRunOperationError, InvalidCiphertextError, InvalidGrantTokenError, InvalidKeyUsageError, KMSInternalError, KMSInvalidStateError, KeyUnavailableError, NotFoundError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model