Using the AWS Encryption SDK with AWS KMS
To use the AWS Encryption SDK, you need to configure keyrings or
master key providers with wrapping keys. If you don't have a key
infrastructure, we recommend using AWS Key Management Service (AWS KMS)
To interact with AWS KMS, the AWS Encryption SDK requires the AWS SDK for your preferred programming language. The AWS Encryption SDK client library works with the AWS SDKs to support master keys stored in AWS KMS.
To prepare to use the AWS Encryption SDK with AWS KMS
-
Create an AWS account. To learn how, see How do I create and activate a new Amazon Web Services account?
in the AWS Knowledge Center. -
Create a symmetric encryption AWS KMS key. For help, see Creating Keys in the AWS Key Management Service Developer Guide.
Tip
To use the AWS KMS key programmatically, you will need the key ID or Amazon Resource Name (ARN) of the AWS KMS key. For help finding the ID or ARN of an AWS KMS key, see Finding the Key ID and ARN in the AWS Key Management Service Developer Guide.
-
Generate an access key ID and security access key. You can use either the access key ID and secret access key for an IAM user or you can use the AWS Security Token Service to create a new session with temporary security credentials that include an access key ID, secret access key, and session token. As a security best practice, we recommend that you use temporary credentials instead of the long-term credentials associated with your IAM user or AWS (root) user accounts.
To create an IAM user with an access key, see Creating IAM Users in the IAM User Guide.
To generate temporary security credentials, see Requesting temporary security credentials in the IAM User Guide.
-
Set your AWS credentials using the instructions in the AWS SDK for Java, AWS SDK for JavaScript, AWS SDK for Python (Boto)
or AWS SDK for C++ (for C), and the access key ID and secret access key that you generated in step 3. If you generated temporary credentials, you will also need to specify the session token. This procedure allows AWS SDKs to sign requests to AWS for you. Code samples in the AWS Encryption SDK that interact with AWS KMS assume that you have completed this step.
-
Download and install the AWS Encryption SDK. To learn how, see the installation instructions for the programming language that you want to use.