Cloud KMS is a cryptographic key management service that encrypts, decrypts, signs, and verifies data under a unified API. It can manage keys secured in software, hardware security modules (HSMs), and external key management system outside of Google Cloud. These keys can be used with algorithms like AES, RSA, and elliptic curve (EC).
These samples show how to use the [Google Cloud KMS API] (https://cloud.google.com/kms/).
-
Enable APIs - Enable the KMS API and create a new project or select an existing project.
-
Install and Initialize Cloud SDK Follow instructions from the available quickstarts
-
Clone the repo and cd into this directory.
$ git clone https://github.com/GoogleCloudPlatform/ruby-docs-samples $ cd ruby-docs-samples/kms
-
Install Dependencies via Bundler.
$ bundle install
-
Set Environment Variables
$ export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
-
Run samples
$ bundle exec ruby snippets.rb
The output will show the help text.
List fixtures that were previously created for the tests by running bundle exec rake fixtures:list
.
Create missing fixtures for the tests by running bundle exec rake fixtures:create
.
Run the acceptance tests for the samples by running bundle exec rake test
.