KmsClient

interface KmsClient : SdkClient

Key Management Service

Key Management Service (KMS) is an encryption and key management web service. This guide describes the KMS operations that you can call programmatically. For general information about KMS, see the Key Management Service Developer Guide.

KMS has replaced the term customer master key (CMK) with KMS key and KMS key. The concept has not changed. To prevent breaking changes, KMS is keeping some variations of this term.

Amazon Web Services provides SDKs that consist of libraries and sample code for various programming languages and platforms (Java, Rust, Python, Ruby, .Net, macOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to KMS and other Amazon Web Services services. For example, the SDKs take care of tasks such as signing requests (see below), managing errors, and retrying requests automatically. For more information about the Amazon Web Services SDKs, including how to download and install them, see Tools for Amazon Web Services.

We recommend that you use the Amazon Web Services SDKs to make programmatic API calls to KMS.

If you need to use FIPS 140-2 validated cryptographic modules when communicating with Amazon Web Services, use one of the FIPS endpoints in your preferred Amazon Web Services Region. If you need communicate over IPv6, use the dual-stack endpoint in your preferred Amazon Web Services Region. For more information see Service endpoints in the Key Management Service topic of the Amazon Web Services General Reference and Dual-stack endpoint support in the KMS Developer Guide.

All KMS API calls must be signed and be transmitted using Transport Layer Security (TLS). KMS recommends you always use the latest supported TLS version. Clients must also support cipher suites with Perfect Forward Secrecy (PFS) such as Ephemeral Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman (ECDHE). Most modern systems such as Java 7 and later support these modes.

Signing Requests

Requests must be signed using an access key ID and a secret access key. We strongly recommend that you do not use your Amazon Web Services account root access key ID and secret access key for everyday work. You can use the access key ID and secret access key for an IAM user or you can use the Security Token Service (STS) to generate temporary security credentials and use those to sign requests.

All KMS requests must be signed with Signature Version 4.

Logging API Requests

KMS supports CloudTrail, a service that logs Amazon Web Services API calls and related events for your Amazon Web Services account and delivers them to an Amazon S3 bucket that you specify. By using the information collected by CloudTrail, you can determine what requests were made to KMS, who made the request, when it was made, and so on. To learn more about CloudTrail, including how to turn it on and find your log files, see the CloudTrail User Guide.

Additional Resources

For more information about credentials and request signing, see the following:

Commonly Used API Operations

Of the API operations discussed in this guide, the following will prove the most useful for most applications. You will likely perform operations other than these, such as creating keys and assigning policies, by using the console.

  • Encrypt

  • Decrypt

  • GenerateDataKey

  • GenerateDataKeyWithoutPlaintext

Properties

Link copied to clipboard
abstract override val config: KmsClient.Config

KmsClient's configuration

Functions

Link copied to clipboard

Cancels the deletion of a KMS key. When this operation succeeds, the key state of the KMS key is Disabled. To enable the KMS key, use EnableKey.

Link copied to clipboard

Connects or reconnects a custom key store to its backing key store. For an CloudHSM key store, ConnectCustomKeyStore connects the key store to its associated CloudHSM cluster. For an external key store, ConnectCustomKeyStore connects the key store to the external key store proxy that communicates with your external key manager.

Link copied to clipboard
abstract suspend fun createAlias(input: CreateAliasRequest): CreateAliasResponse

Creates a friendly name for a KMS key.

Link copied to clipboard

Creates a custom key store backed by a key store that you own and manage. When you use a KMS key in a custom key store for a cryptographic operation, the cryptographic operation is actually performed in your key store using your keys. KMS supports CloudHSM key stores backed by an CloudHSM cluster and external key stores backed by an external key store proxy and external key manager outside of Amazon Web Services.

Link copied to clipboard
abstract suspend fun createGrant(input: CreateGrantRequest): CreateGrantResponse

Adds a grant to a KMS key.

Link copied to clipboard
abstract suspend fun createKey(input: CreateKeyRequest = CreateKeyRequest { }): CreateKeyResponse

Creates a unique customer managed KMS key in your Amazon Web Services account and Region. You can use a KMS key in cryptographic operations, such as encryption and signing. Some Amazon Web Services services let you use KMS keys that you create and manage to protect your service resources.

Link copied to clipboard
abstract suspend fun decrypt(input: DecryptRequest): DecryptResponse

Decrypts ciphertext that was encrypted by a KMS key using any of the following operations:

Link copied to clipboard
abstract suspend fun deleteAlias(input: DeleteAliasRequest): DeleteAliasResponse

Deletes the specified alias.

Link copied to clipboard

Deletes a custom key store. This operation does not affect any backing elements of the custom key store. It does not delete the CloudHSM cluster that is associated with an CloudHSM key store, or affect any users or keys in the cluster. For an external key store, it does not affect the external key store proxy, external key manager, or any external keys.

Link copied to clipboard

Deletes key material that was previously imported. This operation makes the specified KMS key temporarily unusable. To restore the usability of the KMS key, reimport the same key material. For more information about importing key material into KMS, see Importing Key Material in the Key Management Service Developer Guide.

Link copied to clipboard

Derives a shared secret using a key agreement algorithm.

Link copied to clipboard
abstract suspend fun describeCustomKeyStores(input: DescribeCustomKeyStoresRequest = DescribeCustomKeyStoresRequest { }): DescribeCustomKeyStoresResponse

Gets information about custom key stores in the account and Region.

Link copied to clipboard
abstract suspend fun describeKey(input: DescribeKeyRequest): DescribeKeyResponse

Provides detailed information about a KMS key. You can run DescribeKey on a customer managed key or an Amazon Web Services managed key.

Link copied to clipboard
abstract suspend fun disableKey(input: DisableKeyRequest): DisableKeyResponse

Sets the state of a KMS key to disabled. This change temporarily prevents use of the KMS key for cryptographic operations.

Link copied to clipboard

Disables automatic rotation of the key material of the specified symmetric encryption KMS key.

Link copied to clipboard

Disconnects the custom key store from its backing key store. This operation disconnects an CloudHSM key store from its associated CloudHSM cluster or disconnects an external key store from the external key store proxy that communicates with your external key manager.

Link copied to clipboard
abstract suspend fun enableKey(input: EnableKeyRequest): EnableKeyResponse

Sets the key state of a KMS key to enabled. This allows you to use the KMS key for cryptographic operations.

Link copied to clipboard

Enables automatic rotation of the key material of the specified symmetric encryption KMS key.

Link copied to clipboard
abstract suspend fun encrypt(input: EncryptRequest): EncryptResponse

Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a symmetric or asymmetric KMS key with a KeyUsage of ENCRYPT_DECRYPT.

Link copied to clipboard

Returns a unique symmetric data key for use outside of KMS. This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify. The bytes in the plaintext key are random; they are not related to the caller or the KMS key. You can use the plaintext key to encrypt your data outside of KMS and store the encrypted data key with the encrypted data.

Link copied to clipboard

Returns a unique asymmetric data key pair for use outside of KMS. This operation returns a plaintext public key, a plaintext private key, and a copy of the private key that is encrypted under the symmetric encryption KMS key you specify. You can use the data key pair to perform asymmetric cryptography and implement digital signatures outside of KMS. The bytes in the keys are random; they are not related to the caller or to the KMS key that is used to encrypt the private key.

Link copied to clipboard

Returns a unique asymmetric data key pair for use outside of KMS. This operation returns a plaintext public key and a copy of the private key that is encrypted under the symmetric encryption KMS key you specify. Unlike GenerateDataKeyPair, this operation does not return a plaintext private key. The bytes in the keys are random; they are not related to the caller or to the KMS key that is used to encrypt the private key.

Link copied to clipboard

Returns a unique symmetric data key for use outside of KMS. This operation returns a data key that is encrypted under a symmetric encryption KMS key that you specify. The bytes in the key are random; they are not related to the caller or to the KMS key.

Link copied to clipboard
abstract suspend fun generateMac(input: GenerateMacRequest): GenerateMacResponse

Generates a hash-based message authentication code (HMAC) for a message using an HMAC KMS key and a MAC algorithm that the key supports. HMAC KMS keys and the HMAC algorithms that KMS uses conform to industry standards defined in RFC 2104.

Link copied to clipboard
abstract suspend fun generateRandom(input: GenerateRandomRequest = GenerateRandomRequest { }): GenerateRandomResponse

Returns a random byte string that is cryptographically secure.

Link copied to clipboard

Gets a key policy attached to the specified KMS key.

Link copied to clipboard

Provides detailed information about the rotation status for a KMS key, including whether automatic rotation of the key material is enabled for the specified KMS key, the rotation period, and the next scheduled rotation date.

Link copied to clipboard

Returns the public key and an import token you need to import or reimport key material for a KMS key.

Link copied to clipboard

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 keys in the Key Management Service Developer Guide.

Link copied to clipboard

Imports or reimports key material into an existing KMS key that was created without key material. You can also use this operation to set or update the expiration model and expiration date of the imported key material.

Link copied to clipboard
abstract suspend fun listAliases(input: ListAliasesRequest = ListAliasesRequest { }): ListAliasesResponse

Gets a list of aliases in the caller's Amazon Web Services account and region. For more information about aliases, see CreateAlias.

Link copied to clipboard
abstract suspend fun listGrants(input: ListGrantsRequest): ListGrantsResponse

Gets a list of all grants for the specified KMS key.

Link copied to clipboard

Gets the names of the key policies that are attached to a KMS key. This operation is designed to get policy names that you can use in a GetKeyPolicy operation. However, the only valid policy name is default.

Link copied to clipboard

Returns information about the key materials associated with the specified KMS key. You can use the optional IncludeKeyMaterial parameter to control which key materials are included in the response.

Link copied to clipboard
abstract suspend fun listKeys(input: ListKeysRequest = ListKeysRequest { }): ListKeysResponse

Gets a list of all KMS keys in the caller's Amazon Web Services account and Region.

Link copied to clipboard

Returns all tags on the specified KMS key.

Link copied to clipboard

Returns information about all grants in the Amazon Web Services account and Region that have the specified retiring principal.

Link copied to clipboard

Attaches a key policy to the specified KMS key.

Link copied to clipboard
abstract suspend fun reEncrypt(input: ReEncryptRequest): ReEncryptResponse

Decrypts ciphertext and then reencrypts it entirely within KMS. You can use this operation to change the KMS key under which data is encrypted, such as when you manually rotate a KMS key or change the KMS key that protects a ciphertext. You can also use it to reencrypt ciphertext under the same KMS key, such as to change the encryption context of a ciphertext.

Link copied to clipboard

Replicates a multi-Region key into the specified Region. This operation creates a multi-Region replica key based on a multi-Region primary key in a different Region of the same Amazon Web Services partition. You can create multiple replicas of a primary key, but each must be in a different Region. To create a multi-Region primary key, use the CreateKey operation.

Link copied to clipboard
abstract suspend fun retireGrant(input: RetireGrantRequest = RetireGrantRequest { }): RetireGrantResponse

Deletes a grant. Typically, you retire a grant when you no longer need its permissions. To identify the grant to retire, use a grant token, or both the grant ID and a key identifier (key ID or key ARN) of the KMS key. The CreateGrant operation returns both values.

Link copied to clipboard
abstract suspend fun revokeGrant(input: RevokeGrantRequest): RevokeGrantResponse

Deletes the specified grant. You revoke a grant to terminate the permissions that the grant allows. For more information, see Retiring and revoking grants in the Key Management Service Developer Guide.

Link copied to clipboard

Immediately initiates rotation of the key material of the specified symmetric encryption KMS key.

Link copied to clipboard

Schedules the deletion of a KMS key. By default, KMS applies a waiting period of 30 days, but you can specify a waiting period of 7-30 days. When this operation is successful, the key state of the KMS key changes to PendingDeletion and the key can't be used in any cryptographic operations. It remains in this state for the duration of the waiting period. Before the waiting period ends, you can use CancelKeyDeletion to cancel the deletion of the KMS key. After the waiting period ends, KMS deletes the KMS key, its key material, and all KMS data associated with it, including all aliases that refer to it.

Link copied to clipboard
abstract suspend fun sign(input: SignRequest): SignResponse

Creates a digital signature for a message or message digest by using the private key in an asymmetric signing KMS key. To verify the signature, use the Verify operation, or use the public key in the same asymmetric KMS key outside of KMS. For information about asymmetric KMS keys, see Asymmetric KMS keys in the Key Management Service Developer Guide.

Link copied to clipboard
abstract suspend fun tagResource(input: TagResourceRequest): TagResourceResponse

Adds or edits tags on a customer managed key.

Link copied to clipboard

Deletes tags from a customer managed key. To delete a tag, specify the tag key and the KMS key.

Link copied to clipboard
abstract suspend fun updateAlias(input: UpdateAliasRequest): UpdateAliasResponse

Associates an existing KMS alias with a different KMS key. Each alias is associated with only one KMS key at a time, although a KMS key can have multiple aliases. The alias and the KMS key must be in the same Amazon Web Services account and Region.

Link copied to clipboard

Changes the properties of a custom key store. You can use this operation to change the properties of an CloudHSM key store or an external key store.

Link copied to clipboard

Updates the description of a KMS key. To see the description of a KMS key, use DescribeKey.

Link copied to clipboard

Changes the primary key of a multi-Region key.

Link copied to clipboard
abstract suspend fun verify(input: VerifyRequest): VerifyResponse

Verifies a digital signature that was generated by the Sign operation.

Link copied to clipboard
abstract suspend fun verifyMac(input: VerifyMacRequest): VerifyMacResponse

Verifies the hash-based message authentication code (HMAC) for a specified message, HMAC KMS key, and MAC algorithm. To verify the HMAC, VerifyMac computes an HMAC using the message, HMAC KMS key, and MAC algorithm that you specify, and compares the computed HMAC to the HMAC that you specify. If the HMACs are identical, the verification succeeds; otherwise, it fails. Verification indicates that the message hasn't changed since the HMAC was calculated, and the specified key was used to generate and verify the HMAC.

Inherited functions

Link copied to clipboard

Cancels the deletion of a KMS key. When this operation succeeds, the key state of the KMS key is Disabled. To enable the KMS key, use EnableKey.

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard

Connects or reconnects a custom key store to its backing key store. For an CloudHSM key store, ConnectCustomKeyStore connects the key store to its associated CloudHSM cluster. For an external key store, ConnectCustomKeyStore connects the key store to the external key store proxy that communicates with your external key manager.

Link copied to clipboard
inline suspend fun KmsClient.createAlias(crossinline block: CreateAliasRequest.Builder.() -> Unit): CreateAliasResponse

Creates a friendly name for a KMS key.

Link copied to clipboard

Creates a custom key store backed by a key store that you own and manage. When you use a KMS key in a custom key store for a cryptographic operation, the cryptographic operation is actually performed in your key store using your keys. KMS supports CloudHSM key stores backed by an CloudHSM cluster and external key stores backed by an external key store proxy and external key manager outside of Amazon Web Services.

Link copied to clipboard
inline suspend fun KmsClient.createGrant(crossinline block: CreateGrantRequest.Builder.() -> Unit): CreateGrantResponse

Adds a grant to a KMS key.

Link copied to clipboard
inline suspend fun KmsClient.createKey(crossinline block: CreateKeyRequest.Builder.() -> Unit): CreateKeyResponse

Creates a unique customer managed KMS key in your Amazon Web Services account and Region. You can use a KMS key in cryptographic operations, such as encryption and signing. Some Amazon Web Services services let you use KMS keys that you create and manage to protect your service resources.

Link copied to clipboard
inline suspend fun KmsClient.decrypt(crossinline block: DecryptRequest.Builder.() -> Unit): DecryptResponse

Decrypts ciphertext that was encrypted by a KMS key using any of the following operations:

Link copied to clipboard
inline suspend fun KmsClient.deleteAlias(crossinline block: DeleteAliasRequest.Builder.() -> Unit): DeleteAliasResponse

Deletes the specified alias.

Link copied to clipboard

Deletes a custom key store. This operation does not affect any backing elements of the custom key store. It does not delete the CloudHSM cluster that is associated with an CloudHSM key store, or affect any users or keys in the cluster. For an external key store, it does not affect the external key store proxy, external key manager, or any external keys.

Link copied to clipboard

Deletes key material that was previously imported. This operation makes the specified KMS key temporarily unusable. To restore the usability of the KMS key, reimport the same key material. For more information about importing key material into KMS, see Importing Key Material in the Key Management Service Developer Guide.

Link copied to clipboard

Derives a shared secret using a key agreement algorithm.

Link copied to clipboard

Gets information about custom key stores in the account and Region.

Link copied to clipboard
inline suspend fun KmsClient.describeKey(crossinline block: DescribeKeyRequest.Builder.() -> Unit): DescribeKeyResponse

Provides detailed information about a KMS key. You can run DescribeKey on a customer managed key or an Amazon Web Services managed key.

Link copied to clipboard
inline suspend fun KmsClient.disableKey(crossinline block: DisableKeyRequest.Builder.() -> Unit): DisableKeyResponse

Sets the state of a KMS key to disabled. This change temporarily prevents use of the KMS key for cryptographic operations.

Link copied to clipboard

Disables automatic rotation of the key material of the specified symmetric encryption KMS key.

Link copied to clipboard

Disconnects the custom key store from its backing key store. This operation disconnects an CloudHSM key store from its associated CloudHSM cluster or disconnects an external key store from the external key store proxy that communicates with your external key manager.

Link copied to clipboard
inline suspend fun KmsClient.enableKey(crossinline block: EnableKeyRequest.Builder.() -> Unit): EnableKeyResponse

Sets the key state of a KMS key to enabled. This allows you to use the KMS key for cryptographic operations.

Link copied to clipboard

Enables automatic rotation of the key material of the specified symmetric encryption KMS key.

Link copied to clipboard
inline suspend fun KmsClient.encrypt(crossinline block: EncryptRequest.Builder.() -> Unit): EncryptResponse

Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a symmetric or asymmetric KMS key with a KeyUsage of ENCRYPT_DECRYPT.

Link copied to clipboard

Returns a unique symmetric data key for use outside of KMS. This operation returns a plaintext copy of the data key and a copy that is encrypted under a symmetric encryption KMS key that you specify. The bytes in the plaintext key are random; they are not related to the caller or the KMS key. You can use the plaintext key to encrypt your data outside of KMS and store the encrypted data key with the encrypted data.

Link copied to clipboard

Returns a unique asymmetric data key pair for use outside of KMS. This operation returns a plaintext public key, a plaintext private key, and a copy of the private key that is encrypted under the symmetric encryption KMS key you specify. You can use the data key pair to perform asymmetric cryptography and implement digital signatures outside of KMS. The bytes in the keys are random; they are not related to the caller or to the KMS key that is used to encrypt the private key.

Link copied to clipboard

Returns a unique asymmetric data key pair for use outside of KMS. This operation returns a plaintext public key and a copy of the private key that is encrypted under the symmetric encryption KMS key you specify. Unlike GenerateDataKeyPair, this operation does not return a plaintext private key. The bytes in the keys are random; they are not related to the caller or to the KMS key that is used to encrypt the private key.

Link copied to clipboard

Returns a unique symmetric data key for use outside of KMS. This operation returns a data key that is encrypted under a symmetric encryption KMS key that you specify. The bytes in the key are random; they are not related to the caller or to the KMS key.

Link copied to clipboard
inline suspend fun KmsClient.generateMac(crossinline block: GenerateMacRequest.Builder.() -> Unit): GenerateMacResponse

Generates a hash-based message authentication code (HMAC) for a message using an HMAC KMS key and a MAC algorithm that the key supports. HMAC KMS keys and the HMAC algorithms that KMS uses conform to industry standards defined in RFC 2104.

Link copied to clipboard

Returns a random byte string that is cryptographically secure.

Link copied to clipboard
inline suspend fun KmsClient.getKeyPolicy(crossinline block: GetKeyPolicyRequest.Builder.() -> Unit): GetKeyPolicyResponse

Gets a key policy attached to the specified KMS key.

Link copied to clipboard

Provides detailed information about the rotation status for a KMS key, including whether automatic rotation of the key material is enabled for the specified KMS key, the rotation period, and the next scheduled rotation date.

Link copied to clipboard

Returns the public key and an import token you need to import or reimport key material for a KMS key.

Link copied to clipboard
inline suspend fun KmsClient.getPublicKey(crossinline block: GetPublicKeyRequest.Builder.() -> Unit): GetPublicKeyResponse

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 keys in the Key Management Service Developer Guide.

Link copied to clipboard

Imports or reimports key material into an existing KMS key that was created without key material. You can also use this operation to set or update the expiration model and expiration date of the imported key material.

Link copied to clipboard
inline suspend fun KmsClient.listAliases(crossinline block: ListAliasesRequest.Builder.() -> Unit): ListAliasesResponse

Gets a list of aliases in the caller's Amazon Web Services account and region. For more information about aliases, see CreateAlias.

Link copied to clipboard
Link copied to clipboard
inline suspend fun KmsClient.listGrants(crossinline block: ListGrantsRequest.Builder.() -> Unit): ListGrantsResponse

Gets a list of all grants for the specified KMS key.

Link copied to clipboard

Gets the names of the key policies that are attached to a KMS key. This operation is designed to get policy names that you can use in a GetKeyPolicy operation. However, the only valid policy name is default.

Link copied to clipboard

Returns information about the key materials associated with the specified KMS key. You can use the optional IncludeKeyMaterial parameter to control which key materials are included in the response.

Link copied to clipboard
inline suspend fun KmsClient.listKeys(crossinline block: ListKeysRequest.Builder.() -> Unit): ListKeysResponse

Gets a list of all KMS keys in the caller's Amazon Web Services account and Region.

Link copied to clipboard
fun KmsClient.listKeysPaginated(initialRequest: ListKeysRequest = ListKeysRequest { }): Flow<ListKeysResponse>

Paginate over ListKeysResponse results.

Link copied to clipboard

Returns all tags on the specified KMS key.

Link copied to clipboard

Returns information about all grants in the Amazon Web Services account and Region that have the specified retiring principal.

Link copied to clipboard
inline suspend fun KmsClient.putKeyPolicy(crossinline block: PutKeyPolicyRequest.Builder.() -> Unit): PutKeyPolicyResponse

Attaches a key policy to the specified KMS key.

Link copied to clipboard
inline suspend fun KmsClient.reEncrypt(crossinline block: ReEncryptRequest.Builder.() -> Unit): ReEncryptResponse

Decrypts ciphertext and then reencrypts it entirely within KMS. You can use this operation to change the KMS key under which data is encrypted, such as when you manually rotate a KMS key or change the KMS key that protects a ciphertext. You can also use it to reencrypt ciphertext under the same KMS key, such as to change the encryption context of a ciphertext.

Link copied to clipboard
inline suspend fun KmsClient.replicateKey(crossinline block: ReplicateKeyRequest.Builder.() -> Unit): ReplicateKeyResponse

Replicates a multi-Region key into the specified Region. This operation creates a multi-Region replica key based on a multi-Region primary key in a different Region of the same Amazon Web Services partition. You can create multiple replicas of a primary key, but each must be in a different Region. To create a multi-Region primary key, use the CreateKey operation.

Link copied to clipboard
inline suspend fun KmsClient.retireGrant(crossinline block: RetireGrantRequest.Builder.() -> Unit): RetireGrantResponse

Deletes a grant. Typically, you retire a grant when you no longer need its permissions. To identify the grant to retire, use a grant token, or both the grant ID and a key identifier (key ID or key ARN) of the KMS key. The CreateGrant operation returns both values.

Link copied to clipboard
inline suspend fun KmsClient.revokeGrant(crossinline block: RevokeGrantRequest.Builder.() -> Unit): RevokeGrantResponse

Deletes the specified grant. You revoke a grant to terminate the permissions that the grant allows. For more information, see Retiring and revoking grants in the Key Management Service Developer Guide.

Link copied to clipboard

Immediately initiates rotation of the key material of the specified symmetric encryption KMS key.

Link copied to clipboard

Schedules the deletion of a KMS key. By default, KMS applies a waiting period of 30 days, but you can specify a waiting period of 7-30 days. When this operation is successful, the key state of the KMS key changes to PendingDeletion and the key can't be used in any cryptographic operations. It remains in this state for the duration of the waiting period. Before the waiting period ends, you can use CancelKeyDeletion to cancel the deletion of the KMS key. After the waiting period ends, KMS deletes the KMS key, its key material, and all KMS data associated with it, including all aliases that refer to it.

Link copied to clipboard
inline suspend fun KmsClient.sign(crossinline block: SignRequest.Builder.() -> Unit): SignResponse

Creates a digital signature for a message or message digest by using the private key in an asymmetric signing KMS key. To verify the signature, use the Verify operation, or use the public key in the same asymmetric KMS key outside of KMS. For information about asymmetric KMS keys, see Asymmetric KMS keys in the Key Management Service Developer Guide.

Link copied to clipboard
inline suspend fun KmsClient.tagResource(crossinline block: TagResourceRequest.Builder.() -> Unit): TagResourceResponse

Adds or edits tags on a customer managed key.

Link copied to clipboard
inline suspend fun KmsClient.untagResource(crossinline block: UntagResourceRequest.Builder.() -> Unit): UntagResourceResponse

Deletes tags from a customer managed key. To delete a tag, specify the tag key and the KMS key.

Link copied to clipboard
inline suspend fun KmsClient.updateAlias(crossinline block: UpdateAliasRequest.Builder.() -> Unit): UpdateAliasResponse

Associates an existing KMS alias with a different KMS key. Each alias is associated with only one KMS key at a time, although a KMS key can have multiple aliases. The alias and the KMS key must be in the same Amazon Web Services account and Region.

Link copied to clipboard

Changes the properties of a custom key store. You can use this operation to change the properties of an CloudHSM key store or an external key store.

Link copied to clipboard

Updates the description of a KMS key. To see the description of a KMS key, use DescribeKey.

Link copied to clipboard

Changes the primary key of a multi-Region key.

Link copied to clipboard
inline suspend fun KmsClient.verify(crossinline block: VerifyRequest.Builder.() -> Unit): VerifyResponse

Verifies a digital signature that was generated by the Sign operation.

Link copied to clipboard
inline suspend fun KmsClient.verifyMac(crossinline block: VerifyMacRequest.Builder.() -> Unit): VerifyMacResponse

Verifies the hash-based message authentication code (HMAC) for a specified message, HMAC KMS key, and MAC algorithm. To verify the HMAC, VerifyMac computes an HMAC using the message, HMAC KMS key, and MAC algorithm that you specify, and compares the computed HMAC to the HMAC that you specify. If the HMACs are identical, the verification succeeds; otherwise, it fails. Verification indicates that the message hasn't changed since the HMAC was calculated, and the specified key was used to generate and verify the HMAC.

Link copied to clipboard

Create a copy of the client with one or more configuration values overridden. This method allows the caller to perform scoped config overrides for one or more client operations.