This directory contains samples for Google Cloud Key Management Service, which may be used as a reference for how to use this product. The Google Cloud KMS API is a service that allows you to keep encryption keys centrally in the cloud, for direct use by cloud services. More info about Cloud KMS can be found at https://cloud.google.com/kms/docs/ Samples, quickstarts, and other documentation are available at cloud.google.com.
This quickstart shows you how to create and use encryption keys with Cloud Key Management Service.
To run this sample:
-
If this is your first time working with GCP products, you will need to set up the Cloud SDK or utilize Google Cloud Shell. This sample may require authentication and you will need to enable billing.
-
Make a fork of this repo and clone the branch locally, then navigate to the sample directory you want to use.
-
Install the dependencies needed to run the samples.
pip install -r requirements.txt
-
Run the sample using
python quickstart.py
More information about the Cloud KMS quickstart is available at https://cloud.google.com/kms/docs/quickstart
The service account running the tests needs to have the following roles:
- roles/cloudkms.admin
- roles/cloudkms.cryptoKeyEncrypterDecrypter
- roles/cloudkms.cryptoOperator
- roles/cloudkms.publicKeyViewer
- roles/cloudkms.signerVerifier
These samples use the Google Cloud Client Library for Python. You can read the documentation for more details on API usage and use GitHub to browse the source and report issues.
View the contributing guidelines, the Python style guide for more information.