AWS KMS private key creation procedure (for macOS)

Modified on Fri, 19 Jul at 6:09 PM

1. Install AWS CLI

1) Download the macOS pkg file


2) Double-click the downloaded file to start the installer.


3) Follow the on-screen instructions to install the AWS CLI.


2. Create an AWS user for AWS CLI operations


This procedure is performed using the AWS Management Console.


① On the IAM screen of the AWS Management Console, select "Users" and click "Create users."

② Enter any name in "User name", check "Access key - Programmatic access" in "Select AWS credential type", and click "Next: Permissions".



③ Select "Attach existing policies directly", check the policy named, and click "Next: Tags".AWSKeyManagementServicePowerUser


④ Click "Next: Review"


⑤Click “Create user”


Access Key ID 

⑥ The name Secret access key of the IAM user you created  will be displayed, so make a note of it.


Once you close this screen, you will not be able to view your secret access key again, so please be sure to write it down.


3. Configure AWS CLI


① Create a configuration file for AWS CLI authentication

Execute the following command in the terminal. (This will create a configuration file for AWS CLI authentication.)

       

aws configure


The values to be set when executing the command are as follows.
- AWS Access Key ID: Noted down in step "2. Creating an AWS user for AWS CLI operations"
- AWS Secret Access Key: Noted down in step "2. Creating an AWS user for AWS CLI operations"
- Default region name: Any region is fine, but if no region is specified, set "ap-northeast-1"
- Default output format: No problem if left blank


*Please make sure that the region settings match those in the AWS KMS management console! can check this in the pull-down menu in the top right corner of the management console
 


② Applying AWS CLI authentication file


Execute the following command in the terminal. (When you execute it, the authentication file created in ① above will be reflected in the AWS CLI.)


export AWS_REGION=YOUR_REGION

export AWS_PROFILE=YOUR_PROFILE


ex.) YOUR_REGION: ap-northeast-1
ex.) YOUR_PROFILE: default


4. Download and configure nsuite-kms cli


① Access the nsuite-kmscli Github repository


https://github.com/doublejumptokyo/nsuite-kmscli


②Click the latest release version


③ Click "nsuite-kmscli-macOS.tar.gz" to download the executable file.



③ Save the downloaded nsuite-kmscli executable file in any directory.


Unzip the downloaded "nsuite-kmscli-macOS.tar.gz" and store the file "nsuite-kmscli" in any directory.


④ Granting permissions to the file In the terminal, go to the directory that contains "nsuite-kmscli" and execute the following command.



chmod 777 nsuite-kmscli


5. Creating a private key

① Execute the command to create a private key


In the terminal, while in the directory that contains “nsuite-kmscli”, execute the following command (if the command is executed successfully, a private key will be created in AWS KMS).


./nsuite-kmscli new


If you run the command and the following pop-up appears, click "Cancel", perform the "File authentication procedure", and then run the command again.



File authentication procedure



1) Right-click in Finder and click "Open" from the menu that appears.


2) Click "Open" in the popup that appears.

② Confirm the created private key


When you run the command below, the addresses corresponding to the private key you created in AWS KMS will be displayed in a list, and you can confirm that the private key has been created. (The private key itself will not be displayed.)


./nsuite-kmscli list

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article