Skip to content

KMSClient.get_public_key

rboto-kms==0.4.0 · Service index · Types

Model summary (excerpt): Returns the public key of an asymmetric KMS key. Unlike the private key of a asymmetric KMS key, which never leaves KMS unencrypted, callers with kms:GetPublicKey permission can download the public key of an asymmetric KMS key. You can share the public key to allow others to encrypt messages and verify signatures outside of KMS. For information about asymmetric KMS keys, see Asymmetric 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 (
    GetPublicKeyOutput,
)

Signature

async def get_public_key(
    *,
    key_id: str,
    grant_tokens: Sequence[str] | None = None,
) -> GetPublicKeyOutput: ...

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 KMS key that includes the public key. 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:...
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 .

Output

GetPublicKeyOutput.

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 —
public_key bytes | None Always present —
customer_master_key_spec CustomerMasterKeySpecOutput | None Always present CustomerMasterKeySpecOutput
key_spec KeySpecOutput | None Always present KeySpecOutput
key_usage KeyUsageTypeOutput | None Always present KeyUsageTypeOutput
encryption_algorithms list[EncryptionAlgorithmSpecOutput] | None Always present EncryptionAlgorithmSpecOutput
signing_algorithms list[SigningAlgorithmSpecOutput] | None Always present SigningAlgorithmSpecOutput
key_agreement_algorithms list[KeyAgreementAlgorithmSpecOutput] | None Always present KeyAgreementAlgorithmSpecOutput
encapsulation_algorithms list[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.

GetPublicKeyOutput

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, InvalidArnError, InvalidGrantTokenError, InvalidKeyUsageError, KMSInternalError, KMSInvalidStateError, KeyUnavailableError, NotFoundError, UnsupportedOperationError.

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

Service guide · Pinned model