Skip to content

Type definitions#

Index > KMS > Type definitions

Auto-generated documentation for KMS type annotations stubs module mypy-boto3-kms.

BlobTypeDef#

# BlobTypeDef definition

BlobTypeDef = Union[
    str,
    bytes,
    IO[Any],
    StreamingBody,
]

TimestampTypeDef#

# TimestampTypeDef definition

TimestampTypeDef = Union[
    datetime,
    str,
]

AliasListEntryTypeDef#

# AliasListEntryTypeDef definition

class AliasListEntryTypeDef(TypedDict):
    AliasName: NotRequired[str],
    AliasArn: NotRequired[str],
    TargetKeyId: NotRequired[str],
    CreationDate: NotRequired[datetime],
    LastUpdatedDate: NotRequired[datetime],

CancelKeyDeletionRequestRequestTypeDef#

# CancelKeyDeletionRequestRequestTypeDef definition

class CancelKeyDeletionRequestRequestTypeDef(TypedDict):
    KeyId: str,

ResponseMetadataTypeDef#

# ResponseMetadataTypeDef definition

class ResponseMetadataTypeDef(TypedDict):
    RequestId: str,
    HTTPStatusCode: int,
    HTTPHeaders: Dict[str, str],
    RetryAttempts: int,
    HostId: NotRequired[str],

ConnectCustomKeyStoreRequestRequestTypeDef#

# ConnectCustomKeyStoreRequestRequestTypeDef definition

class ConnectCustomKeyStoreRequestRequestTypeDef(TypedDict):
    CustomKeyStoreId: str,

CreateAliasRequestRequestTypeDef#

# CreateAliasRequestRequestTypeDef definition

class CreateAliasRequestRequestTypeDef(TypedDict):
    AliasName: str,
    TargetKeyId: str,

XksProxyAuthenticationCredentialTypeTypeDef#

# XksProxyAuthenticationCredentialTypeTypeDef definition

class XksProxyAuthenticationCredentialTypeTypeDef(TypedDict):
    AccessKeyId: str,
    RawSecretAccessKey: str,

GrantConstraintsTypeDef#

# GrantConstraintsTypeDef definition

class GrantConstraintsTypeDef(TypedDict):
    EncryptionContextSubset: NotRequired[Mapping[str, str]],
    EncryptionContextEquals: NotRequired[Mapping[str, str]],

TagTypeDef#

# TagTypeDef definition

class TagTypeDef(TypedDict):
    TagKey: str,
    TagValue: str,

XksProxyConfigurationTypeTypeDef#

# XksProxyConfigurationTypeTypeDef definition

class XksProxyConfigurationTypeTypeDef(TypedDict):
    Connectivity: NotRequired[XksProxyConnectivityTypeType],  # (1)
    AccessKeyId: NotRequired[str],
    UriEndpoint: NotRequired[str],
    UriPath: NotRequired[str],
    VpcEndpointServiceName: NotRequired[str],
  1. See XksProxyConnectivityTypeType

DeleteAliasRequestRequestTypeDef#

# DeleteAliasRequestRequestTypeDef definition

class DeleteAliasRequestRequestTypeDef(TypedDict):
    AliasName: str,

DeleteCustomKeyStoreRequestRequestTypeDef#

# DeleteCustomKeyStoreRequestRequestTypeDef definition

class DeleteCustomKeyStoreRequestRequestTypeDef(TypedDict):
    CustomKeyStoreId: str,

DeleteImportedKeyMaterialRequestRequestTypeDef#

# DeleteImportedKeyMaterialRequestRequestTypeDef definition

class DeleteImportedKeyMaterialRequestRequestTypeDef(TypedDict):
    KeyId: str,

PaginatorConfigTypeDef#

# PaginatorConfigTypeDef definition

class PaginatorConfigTypeDef(TypedDict):
    MaxItems: NotRequired[int],
    PageSize: NotRequired[int],
    StartingToken: NotRequired[str],

DescribeCustomKeyStoresRequestRequestTypeDef#

# DescribeCustomKeyStoresRequestRequestTypeDef definition

class DescribeCustomKeyStoresRequestRequestTypeDef(TypedDict):
    CustomKeyStoreId: NotRequired[str],
    CustomKeyStoreName: NotRequired[str],
    Limit: NotRequired[int],
    Marker: NotRequired[str],

DescribeKeyRequestRequestTypeDef#

# DescribeKeyRequestRequestTypeDef definition

class DescribeKeyRequestRequestTypeDef(TypedDict):
    KeyId: str,
    GrantTokens: NotRequired[Sequence[str]],

DisableKeyRequestRequestTypeDef#

# DisableKeyRequestRequestTypeDef definition

class DisableKeyRequestRequestTypeDef(TypedDict):
    KeyId: str,

DisableKeyRotationRequestRequestTypeDef#

# DisableKeyRotationRequestRequestTypeDef definition

class DisableKeyRotationRequestRequestTypeDef(TypedDict):
    KeyId: str,

DisconnectCustomKeyStoreRequestRequestTypeDef#

# DisconnectCustomKeyStoreRequestRequestTypeDef definition

class DisconnectCustomKeyStoreRequestRequestTypeDef(TypedDict):
    CustomKeyStoreId: str,

EnableKeyRequestRequestTypeDef#

# EnableKeyRequestRequestTypeDef definition

class EnableKeyRequestRequestTypeDef(TypedDict):
    KeyId: str,

EnableKeyRotationRequestRequestTypeDef#

# EnableKeyRotationRequestRequestTypeDef definition

class EnableKeyRotationRequestRequestTypeDef(TypedDict):
    KeyId: str,
    RotationPeriodInDays: NotRequired[int],

GenerateDataKeyPairWithoutPlaintextRequestRequestTypeDef#

# GenerateDataKeyPairWithoutPlaintextRequestRequestTypeDef definition

class GenerateDataKeyPairWithoutPlaintextRequestRequestTypeDef(TypedDict):
    KeyId: str,
    KeyPairSpec: DataKeyPairSpecType,  # (1)
    EncryptionContext: NotRequired[Mapping[str, str]],
    GrantTokens: NotRequired[Sequence[str]],
    DryRun: NotRequired[bool],
  1. See DataKeyPairSpecType

GenerateDataKeyWithoutPlaintextRequestRequestTypeDef#

# GenerateDataKeyWithoutPlaintextRequestRequestTypeDef definition

class GenerateDataKeyWithoutPlaintextRequestRequestTypeDef(TypedDict):
    KeyId: str,
    EncryptionContext: NotRequired[Mapping[str, str]],
    KeySpec: NotRequired[DataKeySpecType],  # (1)
    NumberOfBytes: NotRequired[int],
    GrantTokens: NotRequired[Sequence[str]],
    DryRun: NotRequired[bool],
  1. See DataKeySpecType

GetKeyPolicyRequestRequestTypeDef#

# GetKeyPolicyRequestRequestTypeDef definition

class GetKeyPolicyRequestRequestTypeDef(TypedDict):
    KeyId: str,
    PolicyName: NotRequired[str],

GetKeyRotationStatusRequestRequestTypeDef#

# GetKeyRotationStatusRequestRequestTypeDef definition

class GetKeyRotationStatusRequestRequestTypeDef(TypedDict):
    KeyId: str,

GetParametersForImportRequestRequestTypeDef#

# GetParametersForImportRequestRequestTypeDef definition

class GetParametersForImportRequestRequestTypeDef(TypedDict):
    KeyId: str,
    WrappingAlgorithm: AlgorithmSpecType,  # (1)
    WrappingKeySpec: WrappingKeySpecType,  # (2)
  1. See AlgorithmSpecType
  2. See WrappingKeySpecType

GetPublicKeyRequestRequestTypeDef#

# GetPublicKeyRequestRequestTypeDef definition

class GetPublicKeyRequestRequestTypeDef(TypedDict):
    KeyId: str,
    GrantTokens: NotRequired[Sequence[str]],

GrantConstraintsPaginatorTypeDef#

# GrantConstraintsPaginatorTypeDef definition

class GrantConstraintsPaginatorTypeDef(TypedDict):
    EncryptionContextSubset: NotRequired[Dict[str, str]],
    EncryptionContextEquals: NotRequired[Dict[str, str]],

KeyListEntryTypeDef#

# KeyListEntryTypeDef definition

class KeyListEntryTypeDef(TypedDict):
    KeyId: NotRequired[str],
    KeyArn: NotRequired[str],

XksKeyConfigurationTypeTypeDef#

# XksKeyConfigurationTypeTypeDef definition

class XksKeyConfigurationTypeTypeDef(TypedDict):
    Id: NotRequired[str],

ListAliasesRequestRequestTypeDef#

# ListAliasesRequestRequestTypeDef definition

class ListAliasesRequestRequestTypeDef(TypedDict):
    KeyId: NotRequired[str],
    Limit: NotRequired[int],
    Marker: NotRequired[str],

ListGrantsRequestRequestTypeDef#

# ListGrantsRequestRequestTypeDef definition

class ListGrantsRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Limit: NotRequired[int],
    Marker: NotRequired[str],
    GrantId: NotRequired[str],
    GranteePrincipal: NotRequired[str],

ListKeyPoliciesRequestRequestTypeDef#

# ListKeyPoliciesRequestRequestTypeDef definition

class ListKeyPoliciesRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Limit: NotRequired[int],
    Marker: NotRequired[str],

ListKeyRotationsRequestRequestTypeDef#

# ListKeyRotationsRequestRequestTypeDef definition

class ListKeyRotationsRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Limit: NotRequired[int],
    Marker: NotRequired[str],

RotationsListEntryTypeDef#

# RotationsListEntryTypeDef definition

class RotationsListEntryTypeDef(TypedDict):
    KeyId: NotRequired[str],
    RotationDate: NotRequired[datetime],
    RotationType: NotRequired[RotationTypeType],  # (1)
  1. See RotationTypeType

ListKeysRequestRequestTypeDef#

# ListKeysRequestRequestTypeDef definition

class ListKeysRequestRequestTypeDef(TypedDict):
    Limit: NotRequired[int],
    Marker: NotRequired[str],

ListResourceTagsRequestRequestTypeDef#

# ListResourceTagsRequestRequestTypeDef definition

class ListResourceTagsRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Limit: NotRequired[int],
    Marker: NotRequired[str],

ListRetirableGrantsRequestRequestTypeDef#

# ListRetirableGrantsRequestRequestTypeDef definition

class ListRetirableGrantsRequestRequestTypeDef(TypedDict):
    RetiringPrincipal: str,
    Limit: NotRequired[int],
    Marker: NotRequired[str],

MultiRegionKeyTypeDef#

# MultiRegionKeyTypeDef definition

class MultiRegionKeyTypeDef(TypedDict):
    Arn: NotRequired[str],
    Region: NotRequired[str],

PutKeyPolicyRequestRequestTypeDef#

# PutKeyPolicyRequestRequestTypeDef definition

class PutKeyPolicyRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Policy: str,
    PolicyName: NotRequired[str],
    BypassPolicyLockoutSafetyCheck: NotRequired[bool],

RetireGrantRequestRequestTypeDef#

# RetireGrantRequestRequestTypeDef definition

class RetireGrantRequestRequestTypeDef(TypedDict):
    GrantToken: NotRequired[str],
    KeyId: NotRequired[str],
    GrantId: NotRequired[str],
    DryRun: NotRequired[bool],

RevokeGrantRequestRequestTypeDef#

# RevokeGrantRequestRequestTypeDef definition

class RevokeGrantRequestRequestTypeDef(TypedDict):
    KeyId: str,
    GrantId: str,
    DryRun: NotRequired[bool],

RotateKeyOnDemandRequestRequestTypeDef#

# RotateKeyOnDemandRequestRequestTypeDef definition

class RotateKeyOnDemandRequestRequestTypeDef(TypedDict):
    KeyId: str,

ScheduleKeyDeletionRequestRequestTypeDef#

# ScheduleKeyDeletionRequestRequestTypeDef definition

class ScheduleKeyDeletionRequestRequestTypeDef(TypedDict):
    KeyId: str,
    PendingWindowInDays: NotRequired[int],

UntagResourceRequestRequestTypeDef#

# UntagResourceRequestRequestTypeDef definition

class UntagResourceRequestRequestTypeDef(TypedDict):
    KeyId: str,
    TagKeys: Sequence[str],

UpdateAliasRequestRequestTypeDef#

# UpdateAliasRequestRequestTypeDef definition

class UpdateAliasRequestRequestTypeDef(TypedDict):
    AliasName: str,
    TargetKeyId: str,

UpdateKeyDescriptionRequestRequestTypeDef#

# UpdateKeyDescriptionRequestRequestTypeDef definition

class UpdateKeyDescriptionRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Description: str,

UpdatePrimaryRegionRequestRequestTypeDef#

# UpdatePrimaryRegionRequestRequestTypeDef definition

class UpdatePrimaryRegionRequestRequestTypeDef(TypedDict):
    KeyId: str,
    PrimaryRegion: str,

EncryptRequestRequestTypeDef#

# EncryptRequestRequestTypeDef definition

class EncryptRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Plaintext: Union[str, bytes, IO[Any], StreamingBody],
    EncryptionContext: NotRequired[Mapping[str, str]],
    GrantTokens: NotRequired[Sequence[str]],
    EncryptionAlgorithm: NotRequired[EncryptionAlgorithmSpecType],  # (1)
    DryRun: NotRequired[bool],
  1. See EncryptionAlgorithmSpecType

GenerateMacRequestRequestTypeDef#

# GenerateMacRequestRequestTypeDef definition

class GenerateMacRequestRequestTypeDef(TypedDict):
    Message: Union[str, bytes, IO[Any], StreamingBody],
    KeyId: str,
    MacAlgorithm: MacAlgorithmSpecType,  # (1)
    GrantTokens: NotRequired[Sequence[str]],
    DryRun: NotRequired[bool],
  1. See MacAlgorithmSpecType

ReEncryptRequestRequestTypeDef#

# ReEncryptRequestRequestTypeDef definition

class ReEncryptRequestRequestTypeDef(TypedDict):
    CiphertextBlob: Union[str, bytes, IO[Any], StreamingBody],
    DestinationKeyId: str,
    SourceEncryptionContext: NotRequired[Mapping[str, str]],
    SourceKeyId: NotRequired[str],
    DestinationEncryptionContext: NotRequired[Mapping[str, str]],
    SourceEncryptionAlgorithm: NotRequired[EncryptionAlgorithmSpecType],  # (1)
    DestinationEncryptionAlgorithm: NotRequired[EncryptionAlgorithmSpecType],  # (1)
    GrantTokens: NotRequired[Sequence[str]],
    DryRun: NotRequired[bool],
  1. See EncryptionAlgorithmSpecType
  2. See EncryptionAlgorithmSpecType

RecipientInfoTypeDef#

# RecipientInfoTypeDef definition

class RecipientInfoTypeDef(TypedDict):
    KeyEncryptionAlgorithm: NotRequired[KeyEncryptionMechanismType],  # (1)
    AttestationDocument: NotRequired[Union[str, bytes, IO[Any], StreamingBody]],
  1. See KeyEncryptionMechanismType

SignRequestRequestTypeDef#

# SignRequestRequestTypeDef definition

class SignRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Message: Union[str, bytes, IO[Any], StreamingBody],
    SigningAlgorithm: SigningAlgorithmSpecType,  # (1)
    MessageType: NotRequired[MessageTypeType],  # (2)
    GrantTokens: NotRequired[Sequence[str]],
    DryRun: NotRequired[bool],
  1. See SigningAlgorithmSpecType
  2. See MessageTypeType

VerifyMacRequestRequestTypeDef#

# VerifyMacRequestRequestTypeDef definition

class VerifyMacRequestRequestTypeDef(TypedDict):
    Message: Union[str, bytes, IO[Any], StreamingBody],
    KeyId: str,
    MacAlgorithm: MacAlgorithmSpecType,  # (1)
    Mac: Union[str, bytes, IO[Any], StreamingBody],
    GrantTokens: NotRequired[Sequence[str]],
    DryRun: NotRequired[bool],
  1. See MacAlgorithmSpecType

VerifyRequestRequestTypeDef#

# VerifyRequestRequestTypeDef definition

class VerifyRequestRequestTypeDef(TypedDict):
    KeyId: str,
    Message: Union[str, bytes, IO[Any], StreamingBody],
    Signature: Union[str, bytes, IO[Any], StreamingBody],
    SigningAlgorithm: SigningAlgorithmSpecType,  # (1)
    MessageType: NotRequired[MessageTypeType],  # (2)
    GrantTokens: NotRequired[Sequence[str]],
    DryRun: NotRequired[bool],
  1. See SigningAlgorithmSpecType
  2. See MessageTypeType

CancelKeyDeletionResponseTypeDef#

# CancelKeyDeletionResponseTypeDef definition

class CancelKeyDeletionResponseTypeDef(TypedDict):
    KeyId: str,
    ResponseMetadata: ResponseMetadataTypeDef,  # (1)
  1. See ResponseMetadataTypeDef

CreateCustomKeyStoreResponseTypeDef#

# CreateCustomKeyStoreResponseTypeDef definition

class CreateCustomKeyStoreResponseTypeDef(TypedDict):
    CustomKeyStoreId: str,
    ResponseMetadata: ResponseMetadataTypeDef,  # (1)
  1. See ResponseMetadataTypeDef

CreateGrantResponseTypeDef#

# CreateGrantResponseTypeDef definition

class CreateGrantResponseTypeDef(TypedDict):
    GrantToken: str,
    GrantId: str,
    ResponseMetadata: ResponseMetadataTypeDef,  # (1)