class ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions extends Resource (View source)

The "cryptoKeyVersions" collection of methods.

Typical usage is:

 $cloudkmsService = new Google\Service\CloudKMS(...);
 $cryptoKeyVersions = $cloudkmsService->projects_locations_keyRings_cryptoKeys_cryptoKeyVersions;

Methods

asymmetricDecrypt(string $name, AsymmetricDecryptRequest $postBody, array $optParams = [])

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

asymmetricSign(string $name, AsymmetricSignRequest $postBody, array $optParams = [])

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

create(string $parent, CryptoKeyVersion $postBody, array $optParams = [])

Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next sequential id. If unset, state will be set to ENABLED.

destroy(string $name, DestroyCryptoKeyVersionRequest $postBody, array $optParams = [])

Schedule a CryptoKeyVersion for destruction. Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED, and destroy_time will be set to the time destroy_scheduled_duration in the future. At that time, the state will automatically change to DESTROYED, and the key material will be irrevocably destroyed. Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process.

get(string $name, array $optParams = [])

Returns metadata for a given CryptoKeyVersion. (cryptoKeyVersions.get)

getPublicKey(string $name, array $optParams = [])

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

import(string $parent, ImportCryptoKeyVersionRequest $postBody, array $optParams = [])

Import wrapped key material into a CryptoKeyVersion. All requests must specify a CryptoKey. If a CryptoKeyVersion is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the CryptoKey. (cryptoKeyVersions.import)

listProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions(string $parent, array $optParams = [])

Lists CryptoKeyVersions.

macSign(string $name, MacSignRequest $postBody, array $optParams = [])

Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.

macVerify(string $name, MacVerifyRequest $postBody, array $optParams = [])

Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful. (cryptoKeyVersions.macVerify)

patch(string $name, CryptoKeyVersion $postBody, array $optParams = [])

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.

rawDecrypt(string $name, RawDecryptRequest $postBody, array $optParams = [])

Decrypts data that was originally encrypted using a raw cryptographic mechanism. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.

rawEncrypt(string $name, RawEncryptRequest $postBody, array $optParams = [])

Encrypts data using portable cryptographic primitives. Most users should choose Encrypt and Decrypt rather than their raw counterparts. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT. (cryptoKeyVersions.rawEncrypt)

restore(string $name, RestoreCryptoKeyVersionRequest $postBody, array $optParams = [])

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. (cryptoKeyVersions.restore)

Details

AsymmetricDecryptResponse asymmetricDecrypt(string $name, AsymmetricDecryptRequest $postBody, array $optParams = [])

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

Parameters

string $name

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

AsymmetricDecryptRequest $postBody
array $optParams

Optional parameters.

Return Value

AsymmetricDecryptResponse

Exceptions

Exception

AsymmetricSignResponse asymmetricSign(string $name, AsymmetricSignRequest $postBody, array $optParams = [])

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

Parameters

string $name

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

AsymmetricSignRequest $postBody
array $optParams

Optional parameters.

Return Value

AsymmetricSignResponse

Exceptions

Exception

CryptoKeyVersion create(string $parent, CryptoKeyVersion $postBody, array $optParams = [])

Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next sequential id. If unset, state will be set to ENABLED.

(cryptoKeyVersions.create)

Parameters

string $parent

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

CryptoKeyVersion $postBody
array $optParams

Optional parameters.

Return Value

CryptoKeyVersion

Exceptions

Exception

CryptoKeyVersion destroy(string $name, DestroyCryptoKeyVersionRequest $postBody, array $optParams = [])

Schedule a CryptoKeyVersion for destruction. Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED, and destroy_time will be set to the time destroy_scheduled_duration in the future. At that time, the state will automatically change to DESTROYED, and the key material will be irrevocably destroyed. Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process.

(cryptoKeyVersions.destroy)

Parameters

string $name

Required. The resource name of the CryptoKeyVersion to destroy.

DestroyCryptoKeyVersionRequest $postBody
array $optParams

Optional parameters.

Return Value

CryptoKeyVersion

Exceptions

Exception

CryptoKeyVersion get(string $name, array $optParams = [])

Returns metadata for a given CryptoKeyVersion. (cryptoKeyVersions.get)

Parameters

string $name

Required. The name of the CryptoKeyVersion to get.

array $optParams

Optional parameters.

Return Value

CryptoKeyVersion

Exceptions

Exception

PublicKey getPublicKey(string $name, array $optParams = [])

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

(cryptoKeyVersions.getPublicKey)

Parameters

string $name

Required. The name of the CryptoKeyVersion public key to get.

array $optParams

Optional parameters.

Return Value

PublicKey

Exceptions

Exception

CryptoKeyVersion import(string $parent, ImportCryptoKeyVersionRequest $postBody, array $optParams = [])

Import wrapped key material into a CryptoKeyVersion. All requests must specify a CryptoKey. If a CryptoKeyVersion is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the CryptoKey. (cryptoKeyVersions.import)

Parameters

string $parent

Required. The name of the CryptoKey to be imported into. The create permission is only required on this key when creating a new CryptoKeyVersion.

ImportCryptoKeyVersionRequest $postBody
array $optParams

Optional parameters.

Return Value

CryptoKeyVersion

Exceptions

Exception

ListCryptoKeyVersionsResponse listProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions(string $parent, array $optParams = [])

Lists CryptoKeyVersions.

(cryptoKeyVersions.listProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions)

Parameters

string $parent

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

array $optParams

Optional parameters.

Return Value

ListCryptoKeyVersionsResponse

Exceptions

Exception

MacSignResponse macSign(string $name, MacSignRequest $postBody, array $optParams = [])

Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.

(cryptoKeyVersions.macSign)

Parameters

string $name

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

MacSignRequest $postBody
array $optParams

Optional parameters.

Return Value

MacSignResponse

Exceptions

Exception

MacVerifyResponse macVerify(string $name, MacVerifyRequest $postBody, array $optParams = [])

Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful. (cryptoKeyVersions.macVerify)

Parameters

string $name

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

MacVerifyRequest $postBody
array $optParams

Optional parameters.

Return Value

MacVerifyResponse

Exceptions

Exception

CryptoKeyVersion patch(string $name, CryptoKeyVersion $postBody, array $optParams = [])

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.

(cryptoKeyVersions.patch)

Parameters

string $name

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

CryptoKeyVersion $postBody
array $optParams

Optional parameters.

Return Value

CryptoKeyVersion

Exceptions

Exception

RawDecryptResponse rawDecrypt(string $name, RawDecryptRequest $postBody, array $optParams = [])

Decrypts data that was originally encrypted using a raw cryptographic mechanism. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.

(cryptoKeyVersions.rawDecrypt)

Parameters

string $name

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

RawDecryptRequest $postBody
array $optParams

Optional parameters.

Return Value

RawDecryptResponse

Exceptions

Exception

RawEncryptResponse rawEncrypt(string $name, RawEncryptRequest $postBody, array $optParams = [])

Encrypts data using portable cryptographic primitives. Most users should choose Encrypt and Decrypt rather than their raw counterparts. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT. (cryptoKeyVersions.rawEncrypt)

Parameters

string $name

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

RawEncryptRequest $postBody
array $optParams

Optional parameters.

Return Value

RawEncryptResponse

Exceptions

Exception

CryptoKeyVersion restore(string $name, RestoreCryptoKeyVersionRequest $postBody, array $optParams = [])

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. (cryptoKeyVersions.restore)

Parameters

string $name

Required. The resource name of the CryptoKeyVersion to restore.

RestoreCryptoKeyVersionRequest $postBody
array $optParams

Optional parameters.

Return Value

CryptoKeyVersion

Exceptions

Exception