- NAME
-
- gcloud kms keys versions get-public-key - get the public key for a given version
- SYNOPSIS
-
-
gcloud kms keys versions get-public-key
VERSION
[--key
=KEY
] [--keyring
=KEYRING
] [--location
=LOCATION
] [--output-file
=OUTPUT_FILE
] [--public-key-format
=PUBLIC_KEY_FORMAT
] [GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
-
Returns the public key of the given asymmetric key version in the specified
format.
The optional flag
output-file
indicates the path to store the public key. If not specified, the public key will be printed to stdout.The optional flag
public-key-format
indicates the format in which the public key will be returned. For the PQC algorithms, this must be specified and set to NIST_PQC. For all other algorithms, this flag is optional and defaults to PEM. See "Retrieve a public key" in the Cloud KMS documentation (https://cloud.google.com/kms/docs/retrieve-public-key) for more information about the supported formats. - EXAMPLES
-
The following command saves the public key for CryptoKey
frodo
Version 2 to '/tmp/my/public_key.file':gcloud kms keys versions get-public-key 2 --key=frodo --keyring=fellowship --location=us-east1 --public-key-format=PEM --output-file=/tmp/my/public_key.file
- POSITIONAL ARGUMENTS
-
VERSION
- Name of the version to get public key.
- FLAGS
-
--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 public key.
--public-key-format
=PUBLIC_KEY_FORMAT
- The format in which the public key will be returned.
- GCLOUD WIDE FLAGS
-
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. - NOTES
-
These variants are also available:
gcloud alpha kms keys versions get-public-key
gcloud beta kms keys versions get-public-key
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-25 UTC.