Symmetric key encryption
Recall that symmetric keys are used for encryption to protect some data—for example, using AES-256 in GCM mode to encrypt a block of plaintext.
Creating a symmetric key
To create a symmetric key, you will first need to create a key ring. The key ring determines the location of the key. Let us start with creating that.
Step 1: Creating a key ring
Here is a gcloud
command to create a key ring:
gcloud kms keyrings create key-ring-name \
--location location
Replace key-ring-name
with a name for the key ring to hold the key. Replace location
with the Cloud KMS location for the key ring and its keys.
Step 2: Creating a key
Use the following command to create a key in an existing key ring:
gcloud kms keys create key \
--keyring key-ring-name \
--location location \
--purpose "encryption"
Replace key
with the name...