Package google.cloud.kms.v1

Index

KeyManagementService

Google Cloud Key Management Service

Manages cryptographic keys and operations using those keys. Implements a REST model with the following objects:

If you are using manual gRPC libraries, see Using gRPC with Cloud KMS.

AsymmetricDecrypt

rpc AsymmetricDecrypt(AsymmetricDecryptRequest) returns (AsymmetricDecryptResponse)

Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

AsymmetricSign

rpc AsymmetricSign(AsymmetricSignRequest) returns (AsymmetricSignResponse)

Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from GetPublicKey.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateCryptoKey

rpc CreateCryptoKey(CreateCryptoKeyRequest) returns (CryptoKey)

Create a new CryptoKey within a KeyRing.

CryptoKey.purpose and CryptoKey.version_template.algorithm are required.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateCryptoKeyVersion

rpc CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest) returns (CryptoKeyVersion)

Create a new CryptoKeyVersion in a CryptoKey.

The server will assign the next sequential id. If unset, state will be set to ENABLED.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateKeyRing

rpc CreateKeyRing(CreateKeyRingRequest) returns (KeyRing)

Create a new KeyRing in a given Project and Location.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Decrypt

rpc Decrypt(DecryptRequest) returns (DecryptResponse)

Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DestroyCryptoKeyVersion

rpc DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest) returns (CryptoKeyVersion)

Schedule a CryptoKeyVersion for destruction.

Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED and destroy_time will be set to a time 24 hours in the future, at which point the state will be changed to DESTROYED, and the key material will be irrevocably destroyed.

Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Encrypt

rpc Encrypt(EncryptRequest) returns (EncryptResponse)

Encrypts data, so that it can only be recovered by a call to Decrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetCryptoKey

rpc GetCryptoKey(GetCryptoKeyRequest) returns (CryptoKey)

Returns metadata for a given CryptoKey, as well as its primary CryptoKeyVersion.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetCryptoKeyVersion

rpc GetCryptoKeyVersion(GetCryptoKeyVersionRequest) returns (CryptoKeyVersion)

Returns metadata for a given CryptoKeyVersion.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetKeyRing

rpc GetKeyRing(GetKeyRingRequest) returns (KeyRing)

Returns metadata for a given KeyRing.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetPublicKey

rpc GetPublicKey(GetPublicKeyRequest) returns (PublicKey)

Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListCryptoKeyVersions

rpc ListCryptoKeyVersions(ListCryptoKeyVersionsRequest) returns (ListCryptoKeyVersionsResponse)

Lists CryptoKeyVersions.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListCryptoKeys

rpc ListCryptoKeys(ListCryptoKeysRequest) returns (ListCryptoKeysResponse)

Lists CryptoKeys.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListKeyRings

rpc ListKeyRings(ListKeyRingsRequest) returns (ListKeyRingsResponse)

Lists KeyRings.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

RestoreCryptoKeyVersion

rpc RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest) returns (CryptoKeyVersion)

Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state.

Upon restoration of the CryptoKeyVersion, state will be set to DISABLED, and destroy_time will be cleared.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateCryptoKey

rpc UpdateCryptoKey(UpdateCryptoKeyRequest) returns (CryptoKey)

Update a CryptoKey.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateCryptoKeyPrimaryVersion

rpc UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest) returns (CryptoKey)

Update the version of a CryptoKey that will be used in Encrypt.

Returns an error if called on an asymmetric key.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateCryptoKeyVersion

rpc UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest) returns (CryptoKeyVersion)

Update a CryptoKeyVersion's metadata.

state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloudkms
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

AsymmetricDecryptRequest

Request message for KeyManagementService.AsymmetricDecrypt.

Fields
name

string

Required. The resource name of the CryptoKeyVersion to use for decryption.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeyVersions.useToDecrypt

ciphertext

bytes

Required. The data encrypted with the named CryptoKeyVersion's public key using OAEP.

AsymmetricDecryptResponse

Response message for KeyManagementService.AsymmetricDecrypt.

Fields
plaintext

bytes

The decrypted data originally encrypted with the matching public key.

AsymmetricSignRequest

Request message for KeyManagementService.AsymmetricSign.

Fields
name

string

Required. The resource name of the CryptoKeyVersion to use for signing.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeyVersions.useToSign

digest

Digest

Required. The digest of the data to sign. The digest must be produced with the same digest algorithm as specified by the key version's algorithm.

AsymmetricSignResponse

Response message for KeyManagementService.AsymmetricSign.

Fields
signature

bytes

The created signature.

CreateCryptoKeyRequest

Request message for KeyManagementService.CreateCryptoKey.

Fields
parent

string

Required. The name of the KeyRing associated with the CryptoKeys.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudkms.cryptoKeys.create

crypto_key_id

string

Required. It must be unique within a KeyRing and match the regular expression [a-zA-Z0-9_-]{1,63}

crypto_key

CryptoKey

A CryptoKey with initial field values.

CreateCryptoKeyVersionRequest

Request message for KeyManagementService.CreateCryptoKeyVersion.

Fields
parent

string

Required. The name of the CryptoKey associated with the CryptoKeyVersions.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudkms.cryptoKeyVersions.create

crypto_key_version

CryptoKeyVersion

A CryptoKeyVersion with initial field values.

CreateKeyRingRequest

Request message for KeyManagementService.CreateKeyRing.

Fields
parent

string

Required. The resource name of the location associated with the KeyRings, in the format projects/*/locations/*.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudkms.keyRings.create

key_ring_id

string

Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}

key_ring

KeyRing

A KeyRing with initial field values.

CryptoKey

A CryptoKey represents a logical key that can be used for cryptographic operations.

A CryptoKey is made up of one or more versions, which represent the actual key material used in cryptographic operations.

Fields
name

string

Output only. The resource name for this CryptoKey in the format projects/*/locations/*/keyRings/*/cryptoKeys/*.

primary

CryptoKeyVersion

Output only. A copy of the "primary" CryptoKeyVersion that will be used by Encrypt when this CryptoKey is given in EncryptRequest.name.

The CryptoKey's primary version can be updated via UpdateCryptoKeyPrimaryVersion.

All keys with purpose ENCRYPT_DECRYPT have a primary. For other keys, this field will be omitted.

purpose

CryptoKeyPurpose

The immutable purpose of this CryptoKey.

create_time

Timestamp

Output only. The time at which this CryptoKey was created.

next_rotation_time

Timestamp

At next_rotation_time, the Key Management Service will automatically:

  1. Create a new version of this CryptoKey.
  2. Mark the new version as primary.

Key rotations performed manually via CreateCryptoKeyVersion and UpdateCryptoKeyPrimaryVersion do not affect next_rotation_time.

Keys with purpose ENCRYPT_DECRYPT support automatic rotation. For other keys, this field must be omitted.

version_template

CryptoKeyVersionTemplate

A template describing settings for new CryptoKeyVersion instances. The properties of new CryptoKeyVersion instances created by either CreateCryptoKeyVersion or auto-rotation are controlled by this template.

labels

map<string, string>

Labels with user-defined metadata. For more information, see Labeling Keys.

rotation_period

Duration

next_rotation_time will be advanced by this period when the service automatically rotates a key. Must be at least one day.

If rotation_period is set, next_rotation_time must also be set.

Keys with purpose ENCRYPT_DECRYPT support automatic rotation. For other keys, this field must be omitted.

CryptoKeyPurpose

CryptoKeyPurpose describes the cryptographic capabilities of a CryptoKey. A given key can only be used for the operations allowed by its purpose.

Enums
CRYPTO_KEY_PURPOSE_UNSPECIFIED Not specified.
ENCRYPT_DECRYPT CryptoKeys with this purpose may be used with Encrypt and Decrypt.
ASYMMETRIC_SIGN CryptoKeys with this purpose may be used with AsymmetricSign and GetPublicKey.
ASYMMETRIC_DECRYPT CryptoKeys with this purpose may be used with AsymmetricDecrypt and GetPublicKey.

CryptoKeyVersion

A CryptoKeyVersion represents an individual cryptographic key, and the associated key material.

An ENABLED version can be used for cryptographic operations.

For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.

Fields
name

string

Output only. The resource name for this CryptoKeyVersion in the format projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*.

state

CryptoKeyVersionState

The current state of the CryptoKeyVersion.

protection_level

ProtectionLevel

Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.

algorithm

CryptoKeyVersionAlgorithm

Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.

attestation

KeyOperationAttestation

Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.

create_time

Timestamp

Output only. The time at which this CryptoKeyVersion was created.

generate_time

Timestamp

Output only. The time this CryptoKeyVersion's key material was generated.

destroy_time

Timestamp

Output only. The time this CryptoKeyVersion's key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.

destroy_event_time

Timestamp

Output only. The time this CryptoKeyVersion's key material was destroyed. Only present if state is DESTROYED.

CryptoKeyVersionAlgorithm

The algorithm of the CryptoKeyVersion, indicating what parameters must be used for each cryptographic operation.

The GOOGLE_SYMMETRIC_ENCRYPTION algorithm is usable with CryptoKey.purpose ENCRYPT_DECRYPT.

Algorithms beginning with "RSA_SIGN_" are usable with CryptoKey.purpose ASYMMETRIC_SIGN.

The fields in the name after "RSA_SIGN_" correspond to the following parameters: padding algorithm, modulus bit length, and digest algorithm.

For PSS, the salt length used is equal to the length of digest algorithm. For example, RSA_SIGN_PSS_2048_SHA256 will use PSS with a salt length of 256 bits or 32 bytes.

Algorithms beginning with "RSA_DECRYPT_" are usable with CryptoKey.purpose ASYMMETRIC_DECRYPT.

The fields in the name after "RSA_DECRYPT_" correspond to the following parameters: padding algorithm, modulus bit length, and digest algorithm.

Algorithms beginning with "EC_SIGN_" are usable with CryptoKey.purpose ASYMMETRIC_SIGN.

The fields in the name after "EC_SIGN_" correspond to the following parameters: elliptic curve, digest algorithm.

Enums
CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED Not specified.
GOOGLE_SYMMETRIC_ENCRYPTION Creates symmetric encryption keys.
RSA_SIGN_PSS_2048_SHA256 RSASSA-PSS 2048 bit key with a SHA256 digest.
RSA_SIGN_PSS_3072_SHA256 RSASSA-PSS 3072 bit key with a SHA256 digest.
RSA_SIGN_PSS_4096_SHA256 RSASSA-PSS 4096 bit key with a SHA256 digest.
RSA_SIGN_PSS_4096_SHA512 RSASSA-PSS 4096 bit key with a SHA512 digest.
RSA_SIGN_PKCS1_2048_SHA256 RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
RSA_SIGN_PKCS1_3072_SHA256 RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
RSA_SIGN_PKCS1_4096_SHA256 RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
RSA_SIGN_PKCS1_4096_SHA512 RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA512 digest.
RSA_DECRYPT_OAEP_2048_SHA256 RSAES-OAEP 2048 bit key with a SHA256 digest.
RSA_DECRYPT_OAEP_3072_SHA256 RSAES-OAEP 3072 bit key with a SHA256 digest.
RSA_DECRYPT_OAEP_4096_SHA256 RSAES-OAEP 4096 bit key with a SHA256 digest.
RSA_DECRYPT_OAEP_4096_SHA512 RSAES-OAEP 4096 bit key with a SHA512 digest.
EC_SIGN_P256_SHA256 ECDSA on the NIST P-256 curve with a SHA256 digest.
EC_SIGN_P384_SHA384 ECDSA on the NIST P-384 curve with a SHA384 digest.

CryptoKeyVersionState

The state of a CryptoKeyVersion, indicating if it can be used.

Enums
CRYPTO_KEY_VERSION_STATE_UNSPECIFIED Not specified.
PENDING_GENERATION This version is still being generated. It may not be used, enabled, disabled, or destroyed yet. Cloud KMS will automatically mark this version ENABLED as soon as the version is ready.
ENABLED This version may be used for cryptographic operations.
DISABLED This version may not be used, but the key material is still available, and the version can be placed back into the ENABLED state.
DESTROYED This version is destroyed, and the key material is no longer stored. A version may not leave this state once entered.
DESTROY_SCHEDULED This version is scheduled for destruction, and will be destroyed soon. Call RestoreCryptoKeyVersion to put it back into the DISABLED state.

CryptoKeyVersionView

A view for CryptoKeyVersions. Controls the level of detail returned for CryptoKeyVersions in KeyManagementService.ListCryptoKeyVersions and KeyManagementService.ListCryptoKeys.

Enums
CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED Default view for each CryptoKeyVersion. Does not include the attestation field.
FULL Provides all fields in each CryptoKeyVersion, including the attestation.

CryptoKeyVersionTemplate

A CryptoKeyVersionTemplate specifies the properties to use when creating a new CryptoKeyVersion, either manually with CreateCryptoKeyVersion or automatically as a result of auto-rotation.

Fields
protection_level

ProtectionLevel

ProtectionLevel to use when creating a CryptoKeyVersion based on this template. Immutable. Defaults to SOFTWARE.

algorithm

CryptoKeyVersionAlgorithm

Required. Algorithm to use when creating a CryptoKeyVersion based on this template.

For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both this field is omitted and CryptoKey.purpose is ENCRYPT_DECRYPT.

DecryptRequest

Request message for KeyManagementService.Decrypt.

Fields
name

string

Required. The resource name of the CryptoKey to use for decryption. The server will choose the appropriate version.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeyVersions.useToDecrypt

ciphertext

bytes

Required. The encrypted data originally returned in EncryptResponse.ciphertext.

additional_authenticated_data

bytes

Optional data that must match the data originally supplied in EncryptRequest.additional_authenticated_data.

DecryptResponse

Response message for KeyManagementService.Decrypt.

Fields
plaintext

bytes

The decrypted data originally supplied in EncryptRequest.plaintext.

DestroyCryptoKeyVersionRequest

Request message for KeyManagementService.DestroyCryptoKeyVersion.

Fields
name

string

The resource name of the CryptoKeyVersion to destroy.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeyVersions.destroy

Digest

A Digest holds a cryptographic message digest.

Fields
Union field digest. Required. The message digest. digest can be only one of the following:
sha256

bytes

A message digest produced with the SHA-256 algorithm.

sha384

bytes

A message digest produced with the SHA-384 algorithm.

sha512

bytes

A message digest produced with the SHA-512 algorithm.

EncryptRequest

Request message for KeyManagementService.Encrypt.

Fields
name

string

Required. The resource name of the CryptoKey or CryptoKeyVersion to use for encryption.

If a CryptoKey is specified, the server will use its primary version.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeyVersions.useToEncrypt

plaintext

bytes

Required. The data to encrypt. Must be no larger than 64KiB.

The maximum size depends on the key version's protection_level. For SOFTWARE keys, the plaintext must be no larger than 64KiB. For HSM keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB.

additional_authenticated_data

bytes

Optional data that, if specified, must also be provided during decryption through DecryptRequest.additional_authenticated_data.

The maximum size depends on the key version's protection_level. For SOFTWARE keys, the AAD must be no larger than 64KiB. For HSM keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB.

EncryptResponse

Response message for KeyManagementService.Encrypt.

Fields
name

string

The resource name of the CryptoKeyVersion used in encryption.

ciphertext

bytes

The encrypted data.

GetCryptoKeyRequest

Request message for KeyManagementService.GetCryptoKey.

Fields
name

string

The name of the CryptoKey to get.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeys.get

GetCryptoKeyVersionRequest

Request message for KeyManagementService.GetCryptoKeyVersion.

Fields
name

string

The name of the CryptoKeyVersion to get.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeyVersions.get

GetKeyRingRequest

Request message for KeyManagementService.GetKeyRing.

Fields
name

string

The name of the KeyRing to get.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.keyRings.get

GetPublicKeyRequest

Request message for KeyManagementService.GetPublicKey.

Fields
name

string

The name of the CryptoKeyVersion public key to get.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeyVersions.viewPublicKey

KeyOperationAttestation

Contains an HSM-generated attestation about a key operation.

Fields
format

AttestationFormat

Output only. The format of the attestation data.

content

bytes

Output only. The attestation data provided by the HSM when the key operation was performed.

AttestationFormat

Attestion formats provided by the HSM.

Enums
ATTESTATION_FORMAT_UNSPECIFIED
CAVIUM_V1_COMPRESSED Cavium HSM attestation compressed with gzip. Note that this format is defined by Cavium and subject to change at any time.

KeyRing

A KeyRing is a toplevel logical grouping of CryptoKeys.

Fields
name

string

Output only. The resource name for the KeyRing in the format projects/*/locations/*/keyRings/*.

create_time

Timestamp

Output only. The time at which this KeyRing was created.

ListCryptoKeyVersionsRequest

Request message for KeyManagementService.ListCryptoKeyVersions.

Fields
parent

string

Required. The resource name of the CryptoKey to list, in the format projects/*/locations/*/keyRings/*/cryptoKeys/*.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudkms.cryptoKeyVersions.list

page_size

int32

Optional limit on the number of CryptoKeyVersions to include in the response. Further CryptoKeyVersions can subsequently be obtained by including the ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

page_token

string

Optional pagination token, returned earlier via ListCryptoKeyVersionsResponse.next_page_token.

view

CryptoKeyVersionView

The fields to include in the response.

ListCryptoKeyVersionsResponse

Response message for KeyManagementService.ListCryptoKeyVersions.

Fields
crypto_key_versions[]

CryptoKeyVersion

The list of CryptoKeyVersions.

next_page_token

string

A token to retrieve next page of results. Pass this value in ListCryptoKeyVersionsRequest.page_token to retrieve the next page of results.

total_size

int32

The total number of CryptoKeyVersions that matched the query.

ListCryptoKeysRequest

Request message for KeyManagementService.ListCryptoKeys.

Fields
parent

string

Required. The resource name of the KeyRing to list, in the format projects/*/locations/*/keyRings/*.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudkms.cryptoKeys.list

page_size

int32

Optional limit on the number of CryptoKeys to include in the response. Further CryptoKeys can subsequently be obtained by including the ListCryptoKeysResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

page_token

string

Optional pagination token, returned earlier via ListCryptoKeysResponse.next_page_token.

version_view

CryptoKeyVersionView

The fields of the primary version to include in the response.

ListCryptoKeysResponse

Response message for KeyManagementService.ListCryptoKeys.

Fields
crypto_keys[]

CryptoKey

The list of CryptoKeys.

next_page_token

string

A token to retrieve next page of results. Pass this value in ListCryptoKeysRequest.page_token to retrieve the next page of results.

total_size

int32

The total number of CryptoKeys that matched the query.

ListKeyRingsRequest

Request message for KeyManagementService.ListKeyRings.

Fields
parent

string

Required. The resource name of the location associated with the KeyRings, in the format projects/*/locations/*.

Authorization requires the following Google IAM permission on the specified resource parent:

  • cloudkms.keyRings.list

page_size

int32

Optional limit on the number of KeyRings to include in the response. Further KeyRings can subsequently be obtained by including the ListKeyRingsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

page_token

string

Optional pagination token, returned earlier via ListKeyRingsResponse.next_page_token.

ListKeyRingsResponse

Response message for KeyManagementService.ListKeyRings.

Fields
key_rings[]

KeyRing

The list of KeyRings.

next_page_token

string

A token to retrieve next page of results. Pass this value in ListKeyRingsRequest.page_token to retrieve the next page of results.

total_size

int32

The total number of KeyRings that matched the query.

LocationMetadata

Cloud KMS metadata for the given google.cloud.location.Location.

Fields
hsm_available

bool

Indicates whether CryptoKeys with protection_level HSM can be created in this location.

ProtectionLevel

ProtectionLevel specifies how cryptographic operations are performed.

Enums
PROTECTION_LEVEL_UNSPECIFIED Not specified.
SOFTWARE Crypto operations are performed in software.
HSM Crypto operations are performed in a Hardware Security Module.

PublicKey

The public key for a given CryptoKeyVersion. Obtained via GetPublicKey.

Fields
pem

string

The public key, encoded in PEM format. For more information, see the RFC 7468 sections for General Considerations and Textual Encoding of Subject Public Key Info.

algorithm

CryptoKeyVersionAlgorithm

The Algorithm associated with this key.

RestoreCryptoKeyVersionRequest

Request message for KeyManagementService.RestoreCryptoKeyVersion.

Fields
name

string

The resource name of the CryptoKeyVersion to restore.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeyVersions.restore

UpdateCryptoKeyPrimaryVersionRequest

Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion.

Fields
name

string

The resource name of the CryptoKey to update.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudkms.cryptoKeys.update

crypto_key_version_id

string

The id of the child CryptoKeyVersion to use as primary.

UpdateCryptoKeyRequest

Request message for KeyManagementService.UpdateCryptoKey.

Fields
crypto_key

CryptoKey

CryptoKey with updated values.

Authorization requires the following Google IAM permission on the specified resource cryptoKey:

  • cloudkms.cryptoKeys.update

update_mask

FieldMask

Required list of fields to be updated in this request.

UpdateCryptoKeyVersionRequest

Request message for KeyManagementService.UpdateCryptoKeyVersion.

Fields
crypto_key_version

CryptoKeyVersion

CryptoKeyVersion with updated values.

Authorization requires the following Google IAM permission on the specified resource cryptoKeyVersion:

  • cloudkms.cryptoKeyVersions.update

update_mask

FieldMask

Required list of fields to be updated in this request.

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud KMS Documentation