Reference documentation and code samples for the Cloud Key Management Service (KMS) V1 API class Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.
REST client for the KeyManagementService service.
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.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the KeyManagementService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all KeyManagementService clients ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.configure do |config| config.timeout = 10.0 end
#asymmetric_decrypt
def asymmetric_decrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse
def asymmetric_decrypt(name: nil, ciphertext: nil, ciphertext_crc32c: nil) -> ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse
Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT.
def asymmetric_decrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse
asymmetric_decrypt
via a request object, either of type
AsymmetricDecryptRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def asymmetric_decrypt(name: nil, ciphertext: nil, ciphertext_crc32c: nil) -> ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse
asymmetric_decrypt
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKeyVersion to use for decryption.
- ciphertext (::String) — Required. The data encrypted with the named CryptoKeyVersion's public key using OAEP.
- ciphertext_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the AsymmetricDecryptRequest.ciphertext. If specified, KeyManagementService will verify the integrity of the received AsymmetricDecryptRequest.ciphertext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(AsymmetricDecryptRequest.ciphertext) is equal to AsymmetricDecryptRequest.ciphertext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::AsymmetricDecryptResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#asymmetric_sign
def asymmetric_sign(request, options = nil) -> ::Google::Cloud::Kms::V1::AsymmetricSignResponse
def asymmetric_sign(name: nil, digest: nil, digest_crc32c: nil, data: nil, data_crc32c: nil) -> ::Google::Cloud::Kms::V1::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.
def asymmetric_sign(request, options = nil) -> ::Google::Cloud::Kms::V1::AsymmetricSignResponse
asymmetric_sign
via a request object, either of type
AsymmetricSignRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::AsymmetricSignRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def asymmetric_sign(name: nil, digest: nil, digest_crc32c: nil, data: nil, data_crc32c: nil) -> ::Google::Cloud::Kms::V1::AsymmetricSignResponse
asymmetric_sign
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKeyVersion to use for signing.
-
digest (::Google::Cloud::Kms::V1::Digest, ::Hash) — Optional. 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.
This field may not be supplied if AsymmetricSignRequest.data is supplied.
- digest_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the AsymmetricSignRequest.digest. If specified, KeyManagementService will verify the integrity of the received AsymmetricSignRequest.digest using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(AsymmetricSignRequest.digest) is equal to AsymmetricSignRequest.digest_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- data (::String) — Optional. The data to sign. It can't be supplied if AsymmetricSignRequest.digest is supplied.
- data_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the AsymmetricSignRequest.data. If specified, KeyManagementService will verify the integrity of the received AsymmetricSignRequest.data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(AsymmetricSignRequest.data) is equal to AsymmetricSignRequest.data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::AsymmetricSignResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the KeyManagementService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_crypto_key
def create_crypto_key(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKey
def create_crypto_key(parent: nil, crypto_key_id: nil, crypto_key: nil, skip_initial_version_creation: nil) -> ::Google::Cloud::Kms::V1::CryptoKey
Create a new CryptoKey within a KeyRing.
CryptoKey.purpose and CryptoKey.version_template.algorithm are required.
def create_crypto_key(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKey
create_crypto_key
via a request object, either of type
CreateCryptoKeyRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_crypto_key(parent: nil, crypto_key_id: nil, crypto_key: nil, skip_initial_version_creation: nil) -> ::Google::Cloud::Kms::V1::CryptoKey
create_crypto_key
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — Required. The name of the KeyRing associated with the CryptoKeys.
-
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 (::Google::Cloud::Kms::V1::CryptoKey, ::Hash) — Required. A CryptoKey with initial field values.
- skip_initial_version_creation (::Boolean) — If set to true, the request will create a CryptoKey without any CryptoKeyVersions. You must manually call CreateCryptoKeyVersion or ImportCryptoKeyVersion before you can use this CryptoKey.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKey)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#create_crypto_key_version
def create_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
def create_crypto_key_version(parent: nil, crypto_key_version: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
Create a new CryptoKeyVersion in a CryptoKey.
The server will assign the next sequential id. If unset, state will be set to ENABLED.
def create_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
create_crypto_key_version
via a request object, either of type
CreateCryptoKeyVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_crypto_key_version(parent: nil, crypto_key_version: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
create_crypto_key_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — Required. The name of the CryptoKey associated with the CryptoKeyVersions.
- crypto_key_version (::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash) — Required. A CryptoKeyVersion with initial field values.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKeyVersion)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#create_import_job
def create_import_job(request, options = nil) -> ::Google::Cloud::Kms::V1::ImportJob
def create_import_job(parent: nil, import_job_id: nil, import_job: nil) -> ::Google::Cloud::Kms::V1::ImportJob
def create_import_job(request, options = nil) -> ::Google::Cloud::Kms::V1::ImportJob
create_import_job
via a request object, either of type
CreateImportJobRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::CreateImportJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_import_job(parent: nil, import_job_id: nil, import_job: nil) -> ::Google::Cloud::Kms::V1::ImportJob
create_import_job
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- parent (::String) — Required. The name of the KeyRing associated with the ImportJobs.
-
import_job_id (::String) — Required. It must be unique within a KeyRing and match the regular
expression
[a-zA-Z0-9_-]{1,63}
- import_job (::Google::Cloud::Kms::V1::ImportJob, ::Hash) — Required. An ImportJob with initial field values.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::ImportJob)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#create_key_ring
def create_key_ring(request, options = nil) -> ::Google::Cloud::Kms::V1::KeyRing
def create_key_ring(parent: nil, key_ring_id: nil, key_ring: nil) -> ::Google::Cloud::Kms::V1::KeyRing
Create a new KeyRing in a given Project and Location.
def create_key_ring(request, options = nil) -> ::Google::Cloud::Kms::V1::KeyRing
create_key_ring
via a request object, either of type
CreateKeyRingRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_key_ring(parent: nil, key_ring_id: nil, key_ring: nil) -> ::Google::Cloud::Kms::V1::KeyRing
create_key_ring
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the location associated with the
KeyRings, in the format
projects/*/locations/*
. -
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 (::Google::Cloud::Kms::V1::KeyRing, ::Hash) — Required. A KeyRing with initial field values.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::KeyRing)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#decrypt
def decrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::DecryptResponse
def decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil) -> ::Google::Cloud::Kms::V1::DecryptResponse
Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT.
def decrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::DecryptResponse
decrypt
via a request object, either of type
DecryptRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::DecryptRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil) -> ::Google::Cloud::Kms::V1::DecryptResponse
decrypt
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKey to use for decryption. The server will choose the appropriate version.
- ciphertext (::String) — Required. The encrypted data originally returned in EncryptResponse.ciphertext.
- additional_authenticated_data (::String) — Optional. Optional data that must match the data originally supplied in EncryptRequest.additional_authenticated_data.
- ciphertext_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the DecryptRequest.ciphertext. If specified, KeyManagementService will verify the integrity of the received DecryptRequest.ciphertext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(DecryptRequest.ciphertext) is equal to DecryptRequest.ciphertext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- additional_authenticated_data_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the DecryptRequest.additional_authenticated_data. If specified, KeyManagementService will verify the integrity of the received DecryptRequest.additional_authenticated_data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(DecryptRequest.additional_authenticated_data) is equal to DecryptRequest.additional_authenticated_data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::DecryptResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#destroy_crypto_key_version
def destroy_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
def destroy_crypto_key_version(name: nil) -> ::Google::Cloud::Kms::V1::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 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.
def destroy_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
destroy_crypto_key_version
via a request object, either of type
DestroyCryptoKeyVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def destroy_crypto_key_version(name: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
destroy_crypto_key_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKeyVersion to destroy.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKeyVersion)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#encrypt
def encrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::EncryptResponse
def encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil) -> ::Google::Cloud::Kms::V1::EncryptResponse
Encrypts data, so that it can only be recovered by a call to Decrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT.
def encrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::EncryptResponse
encrypt
via a request object, either of type
EncryptRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::EncryptRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil) -> ::Google::Cloud::Kms::V1::EncryptResponse
encrypt
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
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.
-
plaintext (::String) — Required. The data to encrypt. Must be no larger than 64KiB.
The maximum size depends on the key version's protection_level. For SOFTWARE, EXTERNAL, and EXTERNAL_VPC 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 (::String) — Optional. 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, EXTERNAL, and EXTERNAL_VPC 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.
- plaintext_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the EncryptRequest.plaintext. If specified, KeyManagementService will verify the integrity of the received EncryptRequest.plaintext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(EncryptRequest.plaintext) is equal to EncryptRequest.plaintext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- additional_authenticated_data_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the EncryptRequest.additional_authenticated_data. If specified, KeyManagementService will verify the integrity of the received EncryptRequest.additional_authenticated_data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(EncryptRequest.additional_authenticated_data) is equal to EncryptRequest.additional_authenticated_data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::EncryptResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#generate_random_bytes
def generate_random_bytes(request, options = nil) -> ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse
def generate_random_bytes(location: nil, length_bytes: nil, protection_level: nil) -> ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse
Generate random bytes using the Cloud KMS randomness source in the provided location.
def generate_random_bytes(request, options = nil) -> ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse
generate_random_bytes
via a request object, either of type
GenerateRandomBytesRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def generate_random_bytes(location: nil, length_bytes: nil, protection_level: nil) -> ::Google::Cloud::Kms::V1::GenerateRandomBytesResponse
generate_random_bytes
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- location (::String) — The project-specific location in which to generate random bytes. For example, "projects/my-project/locations/us-central1".
- length_bytes (::Integer) — The length in bytes of the amount of randomness to retrieve. Minimum 8 bytes, maximum 1024 bytes.
- protection_level (::Google::Cloud::Kms::V1::ProtectionLevel) — The ProtectionLevel to use when generating the random data. Currently, only HSM protection level is supported.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::GenerateRandomBytesResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_crypto_key
def get_crypto_key(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKey
def get_crypto_key(name: nil) -> ::Google::Cloud::Kms::V1::CryptoKey
Returns metadata for a given CryptoKey, as well as its primary CryptoKeyVersion.
def get_crypto_key(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKey
get_crypto_key
via a request object, either of type
GetCryptoKeyRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::GetCryptoKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_crypto_key(name: nil) -> ::Google::Cloud::Kms::V1::CryptoKey
get_crypto_key
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKey)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_crypto_key_version
def get_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
def get_crypto_key_version(name: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
Returns metadata for a given CryptoKeyVersion.
def get_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
get_crypto_key_version
via a request object, either of type
GetCryptoKeyVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_crypto_key_version(name: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
get_crypto_key_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The name of the CryptoKeyVersion to get.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKeyVersion)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_import_job
def get_import_job(request, options = nil) -> ::Google::Cloud::Kms::V1::ImportJob
def get_import_job(name: nil) -> ::Google::Cloud::Kms::V1::ImportJob
Returns metadata for a given ImportJob.
def get_import_job(request, options = nil) -> ::Google::Cloud::Kms::V1::ImportJob
get_import_job
via a request object, either of type
GetImportJobRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::GetImportJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_import_job(name: nil) -> ::Google::Cloud::Kms::V1::ImportJob
get_import_job
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::ImportJob)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_key_ring
def get_key_ring(request, options = nil) -> ::Google::Cloud::Kms::V1::KeyRing
def get_key_ring(name: nil) -> ::Google::Cloud::Kms::V1::KeyRing
Returns metadata for a given KeyRing.
def get_key_ring(request, options = nil) -> ::Google::Cloud::Kms::V1::KeyRing
get_key_ring
via a request object, either of type
GetKeyRingRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_key_ring(name: nil) -> ::Google::Cloud::Kms::V1::KeyRing
get_key_ring
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::KeyRing)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#get_public_key
def get_public_key(request, options = nil) -> ::Google::Cloud::Kms::V1::PublicKey
def get_public_key(name: nil) -> ::Google::Cloud::Kms::V1::PublicKey
Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT.
def get_public_key(request, options = nil) -> ::Google::Cloud::Kms::V1::PublicKey
get_public_key
via a request object, either of type
GetPublicKeyRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_public_key(name: nil) -> ::Google::Cloud::Kms::V1::PublicKey
get_public_key
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The name of the CryptoKeyVersion public key to get.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::PublicKey)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#iam_policy_client
def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Rest::Client
Get the associated client for mix-in of the IAMPolicy.
- (Google::Iam::V1::IAMPolicy::Rest::Client)
#import_crypto_key_version
def import_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
def import_crypto_key_version(parent: nil, crypto_key_version: nil, algorithm: nil, import_job: nil, wrapped_key: nil, rsa_aes_wrapped_key: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
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.
def import_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
import_crypto_key_version
via a request object, either of type
ImportCryptoKeyVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def import_crypto_key_version(parent: nil, crypto_key_version: nil, algorithm: nil, import_job: nil, wrapped_key: nil, rsa_aes_wrapped_key: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
import_crypto_key_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The name of the
CryptoKey to be imported into.
The create permission is only required on this key when creating a new CryptoKeyVersion.
-
crypto_key_version (::String) — Optional. The optional name of
an existing CryptoKeyVersion to
target for an import operation. If this field is not present, a new
CryptoKeyVersion containing the
supplied key material is created.
If this field is present, the supplied key material is imported into the existing CryptoKeyVersion. To import into an existing CryptoKeyVersion, the CryptoKeyVersion must be a child of ImportCryptoKeyVersionRequest.parent, have been previously created via [ImportCryptoKeyVersion][], and be in DESTROYED or IMPORT_FAILED state. The key material and algorithm must match the previous CryptoKeyVersion exactly if the CryptoKeyVersion has ever contained key material.
- algorithm (::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm) — Required. The algorithm of the key being imported. This does not need to match the version_template of the CryptoKey this version imports into.
- import_job (::String) — Required. The name of the ImportJob that was used to wrap this key material.
-
wrapped_key (::String) — Optional. The wrapped key material to import.
Before wrapping, key material must be formatted. If importing symmetric key material, the expected key material format is plain bytes. If importing asymmetric key material, the expected key material format is PKCS#8-encoded DER (the PrivateKeyInfo structure from RFC 5208).
When wrapping with import methods (RSA_OAEP_3072_SHA1_AES_256 or RSA_OAEP_4096_SHA1_AES_256 or RSA_OAEP_3072_SHA256_AES_256 or RSA_OAEP_4096_SHA256_AES_256),
this field must contain the concatenation of:
- An ephemeral AES-256 wrapping key wrapped with the public_key using RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty label.
- The formatted key to be imported, wrapped with the ephemeral AES-256 key using AES-KWP (RFC 5649).
This format is the same as the format produced by PKCS#11 mechanism CKM_RSA_AES_KEY_WRAP.
When wrapping with import methods (RSA_OAEP_3072_SHA256 or RSA_OAEP_4096_SHA256),
this field must contain the formatted key to be imported, wrapped with the public_key using RSAES-OAEP with SHA-256, MGF1 with SHA-256, and an empty label.
- rsa_aes_wrapped_key (::String) — Optional. This field has the same meaning as wrapped_key. Prefer to use that field in new work. Either that field or this field (but not both) must be specified.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKeyVersion)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#initialize
def initialize() { |config| ... } -> Client
Create a new KeyManagementService REST client object.
- (config) — Configure the KeyManagementService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Kms::V1::KeyManagementService::Rest::Client.new do |config| config.timeout = 10.0 end
#list_crypto_key_versions
def list_crypto_key_versions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>
def list_crypto_key_versions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>
Lists CryptoKeyVersions.
def list_crypto_key_versions(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>
list_crypto_key_versions
via a request object, either of type
ListCryptoKeyVersionsRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_crypto_key_versions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>
list_crypto_key_versions
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the
CryptoKey to list, in the format
projects/*/locations/*/keyRings/*/cryptoKeys/*
. - page_size (::Integer) — Optional. 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. Optional pagination token, returned earlier via ListCryptoKeyVersionsResponse.next_page_token.
- view (::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView) — The fields to include in the response.
- filter (::String) — Optional. Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.
- order_by (::String) — Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKeyVersion>)
- (::Google::Cloud::Error) — if the REST call is aborted.
#list_crypto_keys
def list_crypto_keys(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>
def list_crypto_keys(parent: nil, page_size: nil, page_token: nil, version_view: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>
Lists CryptoKeys.
def list_crypto_keys(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>
list_crypto_keys
via a request object, either of type
ListCryptoKeysRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::ListCryptoKeysRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_crypto_keys(parent: nil, page_size: nil, page_token: nil, version_view: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>
list_crypto_keys
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the KeyRing
to list, in the format
projects/*/locations/*/keyRings/*
. - page_size (::Integer) — Optional. 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. Optional pagination token, returned earlier via ListCryptoKeysResponse.next_page_token.
- version_view (::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionView) — The fields of the primary version to include in the response.
- filter (::String) — Optional. Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.
- order_by (::String) — Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::CryptoKey>)
- (::Google::Cloud::Error) — if the REST call is aborted.
#list_import_jobs
def list_import_jobs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>
def list_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>
Lists ImportJobs.
def list_import_jobs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>
list_import_jobs
via a request object, either of type
ListImportJobsRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>
list_import_jobs
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the KeyRing
to list, in the format
projects/*/locations/*/keyRings/*
. - page_size (::Integer) — Optional. Optional limit on the number of ImportJobs to include in the response. Further ImportJobs can subsequently be obtained by including the ListImportJobsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
- page_token (::String) — Optional. Optional pagination token, returned earlier via ListImportJobsResponse.next_page_token.
- filter (::String) — Optional. Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.
- order_by (::String) — Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::ImportJob>)
- (::Google::Cloud::Error) — if the REST call is aborted.
#list_key_rings
def list_key_rings(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>
def list_key_rings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>
Lists KeyRings.
def list_key_rings(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>
list_key_rings
via a request object, either of type
ListKeyRingsRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::ListKeyRingsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_key_rings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>
list_key_rings
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the location associated with the
KeyRings, in the format
projects/*/locations/*
. - page_size (::Integer) — Optional. 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. Optional pagination token, returned earlier via ListKeyRingsResponse.next_page_token.
- filter (::String) — Optional. Only include resources that match the filter in the response. For more information, see Sorting and filtering list results.
- order_by (::String) — Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see Sorting and filtering list results.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::Kms::V1::KeyRing>)
- (::Google::Cloud::Error) — if the REST call is aborted.
#location_client
def location_client() -> Google::Cloud::Location::Locations::Rest::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Rest::Client)
#mac_sign
def mac_sign(request, options = nil) -> ::Google::Cloud::Kms::V1::MacSignResponse
def mac_sign(name: nil, data: nil, data_crc32c: nil) -> ::Google::Cloud::Kms::V1::MacSignResponse
Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.
def mac_sign(request, options = nil) -> ::Google::Cloud::Kms::V1::MacSignResponse
mac_sign
via a request object, either of type
MacSignRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::MacSignRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def mac_sign(name: nil, data: nil, data_crc32c: nil) -> ::Google::Cloud::Kms::V1::MacSignResponse
mac_sign
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKeyVersion to use for signing.
- data (::String) — Required. The data to sign. The MAC tag is computed over this data field based on the specific algorithm.
- data_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the MacSignRequest.data. If specified, KeyManagementService will verify the integrity of the received MacSignRequest.data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(MacSignRequest.data) is equal to MacSignRequest.data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::MacSignResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#mac_verify
def mac_verify(request, options = nil) -> ::Google::Cloud::Kms::V1::MacVerifyResponse
def mac_verify(name: nil, data: nil, data_crc32c: nil, mac: nil, mac_crc32c: nil) -> ::Google::Cloud::Kms::V1::MacVerifyResponse
Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful.
def mac_verify(request, options = nil) -> ::Google::Cloud::Kms::V1::MacVerifyResponse
mac_verify
via a request object, either of type
MacVerifyRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::MacVerifyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def mac_verify(name: nil, data: nil, data_crc32c: nil, mac: nil, mac_crc32c: nil) -> ::Google::Cloud::Kms::V1::MacVerifyResponse
mac_verify
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKeyVersion to use for verification.
- data (::String) — Required. The data used previously as a MacSignRequest.data to generate the MAC tag.
- data_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the MacVerifyRequest.data. If specified, KeyManagementService will verify the integrity of the received MacVerifyRequest.data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(MacVerifyRequest.data) is equal to MacVerifyRequest.data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- mac (::String) — Required. The signature to verify.
- mac_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the MacVerifyRequest.mac. If specified, KeyManagementService will verify the integrity of the received MacVerifyRequest.mac using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C([MacVerifyRequest.tag][]) is equal to MacVerifyRequest.mac_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::MacVerifyResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#raw_decrypt
def raw_decrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::RawDecryptResponse
def raw_decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, initialization_vector: nil, tag_length: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector_crc32c: nil) -> ::Google::Cloud::Kms::V1::RawDecryptResponse
Decrypts data that was originally encrypted using a raw cryptographic mechanism. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.
def raw_decrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::RawDecryptResponse
raw_decrypt
via a request object, either of type
RawDecryptRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::RawDecryptRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def raw_decrypt(name: nil, ciphertext: nil, additional_authenticated_data: nil, initialization_vector: nil, tag_length: nil, ciphertext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector_crc32c: nil) -> ::Google::Cloud::Kms::V1::RawDecryptResponse
raw_decrypt
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKeyVersion to use for decryption.
- ciphertext (::String) — Required. The encrypted data originally returned in RawEncryptResponse.ciphertext.
- additional_authenticated_data (::String) — Optional. Optional data that must match the data originally supplied in RawEncryptRequest.additional_authenticated_data.
- initialization_vector (::String) — Required. The initialization vector (IV) used during encryption, which must match the data originally provided in RawEncryptResponse.initialization_vector.
- tag_length (::Integer) — The length of the authentication tag that is appended to the end of the ciphertext. If unspecified (0), the default value for the key's algorithm will be used (for AES-GCM, the default value is 16).
- ciphertext_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the RawDecryptRequest.ciphertext. If specified, KeyManagementService will verify the integrity of the received ciphertext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(ciphertext) is equal to ciphertext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- additional_authenticated_data_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the RawDecryptRequest.additional_authenticated_data. If specified, KeyManagementService will verify the integrity of the received additional_authenticated_data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(additional_authenticated_data) is equal to additional_authenticated_data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- initialization_vector_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the RawDecryptRequest.initialization_vector. If specified, KeyManagementService will verify the integrity of the received initialization_vector using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::RawDecryptResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#raw_encrypt
def raw_encrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::RawEncryptResponse
def raw_encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector: nil, initialization_vector_crc32c: nil) -> ::Google::Cloud::Kms::V1::RawEncryptResponse
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.
def raw_encrypt(request, options = nil) -> ::Google::Cloud::Kms::V1::RawEncryptResponse
raw_encrypt
via a request object, either of type
RawEncryptRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::RawEncryptRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def raw_encrypt(name: nil, plaintext: nil, additional_authenticated_data: nil, plaintext_crc32c: nil, additional_authenticated_data_crc32c: nil, initialization_vector: nil, initialization_vector_crc32c: nil) -> ::Google::Cloud::Kms::V1::RawEncryptResponse
raw_encrypt
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKeyVersion to use for encryption.
-
plaintext (::String) — 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 (::String) — Optional. Optional data that, if specified, must also be provided during
decryption through
RawDecryptRequest.additional_authenticated_data.
This field may only be used in conjunction with an algorithm that accepts additional authenticated data (for example, AES-GCM).
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.
- plaintext_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the RawEncryptRequest.plaintext. If specified, KeyManagementService will verify the integrity of the received plaintext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(plaintext) is equal to plaintext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- additional_authenticated_data_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the RawEncryptRequest.additional_authenticated_data. If specified, KeyManagementService will verify the integrity of the received additional_authenticated_data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(additional_authenticated_data) is equal to additional_authenticated_data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- initialization_vector (::String) — Optional. A customer-supplied initialization vector that will be used for encryption. If it is not provided for AES-CBC and AES-CTR, one will be generated. It will be returned in RawEncryptResponse.initialization_vector.
- initialization_vector_crc32c (::Google::Protobuf::Int64Value, ::Hash) — Optional. An optional CRC32C checksum of the RawEncryptRequest.initialization_vector. If specified, KeyManagementService will verify the integrity of the received initialization_vector using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::RawEncryptResponse)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#restore_crypto_key_version
def restore_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
def restore_crypto_key_version(name: nil) -> ::Google::Cloud::Kms::V1::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.
def restore_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
restore_crypto_key_version
via a request object, either of type
RestoreCryptoKeyVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def restore_crypto_key_version(name: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
restore_crypto_key_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKeyVersion to restore.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKeyVersion)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#update_crypto_key
def update_crypto_key(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKey
def update_crypto_key(crypto_key: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::CryptoKey
Update a CryptoKey.
def update_crypto_key(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKey
update_crypto_key
via a request object, either of type
UpdateCryptoKeyRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_crypto_key(crypto_key: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::CryptoKey
update_crypto_key
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- crypto_key (::Google::Cloud::Kms::V1::CryptoKey, ::Hash) — Required. CryptoKey with updated values.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. List of fields to be updated in this request.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKey)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#update_crypto_key_primary_version
def update_crypto_key_primary_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKey
def update_crypto_key_primary_version(name: nil, crypto_key_version_id: nil) -> ::Google::Cloud::Kms::V1::CryptoKey
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.
def update_crypto_key_primary_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKey
update_crypto_key_primary_version
via a request object, either of type
UpdateCryptoKeyPrimaryVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_crypto_key_primary_version(name: nil, crypto_key_version_id: nil) -> ::Google::Cloud::Kms::V1::CryptoKey
update_crypto_key_primary_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The resource name of the CryptoKey to update.
- crypto_key_version_id (::String) — Required. The id of the child CryptoKeyVersion to use as primary.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKey)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
#update_crypto_key_version
def update_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
def update_crypto_key_version(crypto_key_version: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::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.
def update_crypto_key_version(request, options = nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
update_crypto_key_version
via a request object, either of type
UpdateCryptoKeyVersionRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_crypto_key_version(crypto_key_version: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::CryptoKeyVersion
update_crypto_key_version
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- crypto_key_version (::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash) — Required. CryptoKeyVersion with updated values.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. List of fields to be updated in this request.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::Kms::V1::CryptoKeyVersion)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.