gcloud beta kms keys versions get-public-key - get the public key for a given version
gcloud beta kms keys versions get-public-key VERSION [--key=KEY] [--keyring=KEYRING] [--location=LOCATION] [--output-file=OUTPUT_FILE] [GCLOUD_WIDE_FLAG ...]
(BETA) Returns the PEM-format public key for the specified asymmetric key version.
The optional flag output-file indicates the path to store PEM. If not specified. PEM will be printed to stdout.
The following command saves the public key for CryptoKey frodo Version 2 to '/tmp/my/pem.file':
$ gcloud beta kms keys versions get-public-key 2 --key=frodo \ --keyring=fellowship --location=us-east1 \ --output-file=/tmp/my/pem.file
- VERSION
Name of the version to get public key.
- --key=KEY
The containing key.
- --keyring=KEYRING
Key ring of the key.
- --location=LOCATION
Location of the keyring.
- --output-file=OUTPUT_FILE
Path to the output file to store PEM.
These flags are available to all commands: --access-token-file, --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity.
Run $ gcloud help for details.
This command is currently in beta and might change without notice. These variants are also available:
$ gcloud kms keys versions get-public-key
$ gcloud alpha kms keys versions get-public-key