class ProjectsLocationsKeyRingsCryptoKeys extends Resource (View source)

The "cryptoKeys" collection of methods.

Typical usage is:

 $cloudkmsService = new Google\Service\CloudKMS(...);
 $cryptoKeys = $cloudkmsService->projects_locations_keyRings_cryptoKeys;

Methods

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

Create a new CryptoKey within a KeyRing. CryptoKey.purpose and CryptoKey.version_template.algorithm are required. (cryptoKeys.create)

decrypt(string $name, DecryptRequest $postBody, array $optParams = [])

Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT. (cryptoKeys.decrypt)

encrypt(string $name, EncryptRequest $postBody, array $optParams = [])

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

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

Returns metadata for a given CryptoKey, as well as its primary CryptoKeyVersion. (cryptoKeys.get)

getIamPolicy(string $resource, array $optParams = [])

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. (cryptoKeys.getIamPolicy)

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

Lists CryptoKeys. (cryptoKeys.listProjectsLocationsKeyRingsCryptoKeys)

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

Update a CryptoKey. (cryptoKeys.patch)

setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on the specified resource. Replaces any existing policy. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors. (cryptoKeys.setIamPolicy)

testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking.

updatePrimaryVersion(string $name, UpdateCryptoKeyPrimaryVersionRequest $postBody, array $optParams = [])

Update the version of a CryptoKey that will be used in Encrypt. Returns an error if called on a key whose purpose is not ENCRYPT_DECRYPT.

Details

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

Create a new CryptoKey within a KeyRing. CryptoKey.purpose and CryptoKey.version_template.algorithm are required. (cryptoKeys.create)

Parameters

string $parent

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

CryptoKey $postBody
array $optParams

Optional parameters.

Return Value

CryptoKey

Exceptions

Exception

DecryptResponse decrypt(string $name, DecryptRequest $postBody, array $optParams = [])

Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT. (cryptoKeys.decrypt)

Parameters

string $name

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

DecryptRequest $postBody
array $optParams

Optional parameters.

Return Value

DecryptResponse

Exceptions

Exception

EncryptResponse encrypt(string $name, EncryptRequest $postBody, array $optParams = [])

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

Parameters

string $name

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.

EncryptRequest $postBody
array $optParams

Optional parameters.

Return Value

EncryptResponse

Exceptions

Exception

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

Returns metadata for a given CryptoKey, as well as its primary CryptoKeyVersion. (cryptoKeys.get)

Parameters

string $name

Required. The name of the CryptoKey to get.

array $optParams

Optional parameters.

Return Value

CryptoKey

Exceptions

Exception

Policy getIamPolicy(string $resource, array $optParams = [])

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. (cryptoKeys.getIamPolicy)

Parameters

string $resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

ListCryptoKeysResponse listProjectsLocationsKeyRingsCryptoKeys(string $parent, array $optParams = [])

Lists CryptoKeys. (cryptoKeys.listProjectsLocationsKeyRingsCryptoKeys)

Parameters

string $parent

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

array $optParams

Optional parameters.

Return Value

ListCryptoKeysResponse

Exceptions

Exception

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

Update a CryptoKey. (cryptoKeys.patch)

Parameters

string $name

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

CryptoKey $postBody
array $optParams

Optional parameters.

Return Value

CryptoKey

Exceptions

Exception

Policy setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on the specified resource. Replaces any existing policy. Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors. (cryptoKeys.setIamPolicy)

Parameters

string $resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

SetIamPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TestIamPermissionsResponse testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking.

This operation may "fail open" without warning. (cryptoKeys.testIamPermissions)

Parameters

string $resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

TestIamPermissionsRequest $postBody
array $optParams

Optional parameters.

Return Value

TestIamPermissionsResponse

Exceptions

Exception

CryptoKey updatePrimaryVersion(string $name, UpdateCryptoKeyPrimaryVersionRequest $postBody, array $optParams = [])

Update the version of a CryptoKey that will be used in Encrypt. Returns an error if called on a key whose purpose is not ENCRYPT_DECRYPT.

(cryptoKeys.updatePrimaryVersion)

Parameters

string $name

Required. The resource name of the CryptoKey to update.

UpdateCryptoKeyPrimaryVersionRequest $postBody
array $optParams

Optional parameters.

Return Value

CryptoKey

Exceptions

Exception