Learn R Programming

paws.security.identity (version 0.1.12)

kms: AWS Key Management Service

Description

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

AWS provides SDKs that consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .Net, macOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to AWS KMS and other AWS 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 AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.

We recommend that you use the AWS SDKs to make programmatic API calls to AWS KMS.

Clients must support TLS (Transport Layer Security) 1.0. We recommend TLS 1.2. 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 by using an access key ID and a secret access key. We strongly recommend that you do not use your AWS account (root) access key ID and secret key for everyday work with AWS KMS. Instead, use the access key ID and secret access key for an IAM user. You can also use the AWS Security Token Service to generate temporary security credentials that you can use to sign requests.

All AWS KMS operations require Signature Version 4.

Logging API Requests

AWS KMS supports AWS CloudTrail, a service that logs AWS API calls and related events for your AWS 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 AWS 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 AWS 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

  • generate_data_key

  • generate_data_key_without_plaintext

Usage

kms(config = list())

Value

A client for the service. You can call the service's operations using syntax like svc$operation(...), where svc is the name you've assigned to the client. The available operations are listed in the Operations section.

Arguments

config

Optional configuration of credentials, endpoint, and/or region.

Service syntax

svc <- kms(
  config = list(
    credentials = list(
      creds = list(
        access_key_id = "string",
        secret_access_key = "string",
        session_token = "string"
      ),
      profile = "string"
    ),
    endpoint = "string",
    region = "string"
  )
)

Operations

cancel_key_deletionCancels the deletion of a customer master key (CMK)
connect_custom_key_storeConnects or reconnects a custom key store to its associated AWS CloudHSM cluster
create_aliasCreates a friendly name for a customer master key (CMK)
create_custom_key_storeCreates a custom key store that is associated with an AWS CloudHSM cluster that you own and manage
create_grantAdds a grant to a customer master key (CMK)
create_keyCreates a unique customer managed customer master key (CMK) in your AWS account and Region
decryptDecrypts ciphertext that was encrypted by a AWS KMS customer master key (CMK) using any of the following operations:
delete_aliasDeletes the specified alias
delete_custom_key_storeDeletes a custom key store
delete_imported_key_materialDeletes key material that you previously imported
describe_custom_key_storesGets information about custom key stores in the account and region
describe_keyProvides detailed information about a customer master key (CMK)
disable_keySets the state of a customer master key (CMK) to disabled
disable_key_rotationDisables automatic rotation of the key material for the specified symmetric customer master key (CMK)
disconnect_custom_key_storeDisconnects the custom key store from its associated AWS CloudHSM cluster
enable_keySets the key state of a customer master key (CMK) to enabled
enable_key_rotationEnables automatic rotation of the key material for the specified symmetric customer master key (CMK)
encryptEncrypts plaintext into ciphertext by using a customer master key (CMK)
generate_data_keyGenerates a unique symmetric data key for client-side encryption
generate_data_key_pairGenerates a unique asymmetric data key pair
generate_data_key_pair_without_plaintextGenerates a unique asymmetric data key pair
generate_data_key_without_plaintextGenerates a unique symmetric data key
generate_randomReturns a random byte string that is cryptographically secure
get_key_policyGets a key policy attached to the specified customer master key (CMK)
get_key_rotation_statusGets a Boolean value that indicates whether automatic rotation of the key material is enabled for the specified customer master key (CMK)
get_parameters_for_importReturns the items you need to import key material into a symmetric, customer managed customer master key (CMK)
get_public_keyReturns the public key of an asymmetric CMK
import_key_materialImports key material into an existing symmetric AWS KMS customer master key (CMK) that was created without key material
list_aliasesGets a list of aliases in the caller's AWS account and region
list_grantsGets a list of all grants for the specified customer master key (CMK)
list_key_policiesGets the names of the key policies that are attached to a customer master key (CMK)
list_keysGets a list of all customer master keys (CMKs) in the caller's AWS account and Region
list_resource_tagsReturns all tags on the specified customer master key (CMK)
list_retirable_grantsReturns all grants in which the specified principal is the RetiringPrincipal in the grant
put_key_policyAttaches a key policy to the specified customer master key (CMK)
re_encryptDecrypts ciphertext and then reencrypts it entirely within AWS KMS
retire_grantRetires a grant
revoke_grantRevokes the specified grant for the specified customer master key (CMK)
schedule_key_deletionSchedules the deletion of a customer master key (CMK)
signCreates a digital signature for a message or message digest by using the private key in an asymmetric CMK
tag_resourceAdds or edits tags on a customer managed CMK
untag_resourceDeletes tags from a customer managed CMK
update_aliasAssociates an existing AWS KMS alias with a different customer master key (CMK)
update_custom_key_storeChanges the properties of a custom key store
update_key_descriptionUpdates the description of a customer master key (CMK)
verifyVerifies a digital signature that was generated by the Sign operation

Examples

Run this code
if (FALSE) {
svc <- kms()
# The following example cancels deletion of the specified CMK.
svc$cancel_key_deletion(
  KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab"
)
}

Run the code above in your browser using DataLab