Google Cloud Key Management Service v1 API - Class KeyManagementServiceClientImpl (3.14.0)

public sealed class KeyManagementServiceClientImpl : KeyManagementServiceClient

Reference documentation and code samples for the Google Cloud Key Management Service v1 API class KeyManagementServiceClientImpl.

KeyManagementService client wrapper implementation, for convenient use.

Inheritance

object > KeyManagementServiceClient > KeyManagementServiceClientImpl

Namespace

Google.Cloud.Kms.V1

Assembly

Google.Cloud.Kms.V1.dll

Remarks

Google Cloud Key Management Service

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

  • [KeyRing][google.cloud.kms.v1.KeyRing]
  • [CryptoKey][google.cloud.kms.v1.CryptoKey]
  • [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
  • [ImportJob][google.cloud.kms.v1.ImportJob]

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

Constructors

KeyManagementServiceClientImpl(KeyManagementServiceClient, KeyManagementServiceSettings, ILogger)

public KeyManagementServiceClientImpl(KeyManagementService.KeyManagementServiceClient grpcClient, KeyManagementServiceSettings settings, ILogger logger)

Constructs a client wrapper for the KeyManagementService service, with the specified gRPC client and settings.

Parameters
Name Description
grpcClient KeyManagementServiceKeyManagementServiceClient

The underlying gRPC client.

settings KeyManagementServiceSettings

The base KeyManagementServiceSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

GrpcClient

public override KeyManagementService.KeyManagementServiceClient GrpcClient { get; }

The underlying gRPC KeyManagementService client

Property Value
Type Description
KeyManagementServiceKeyManagementServiceClient
Overrides

IAMPolicyClient

public override IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient
Overrides

LocationsClient

public override LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient
Overrides

Methods

AsymmetricDecrypt(AsymmetricDecryptRequest, CallSettings)

public override AsymmetricDecryptResponse AsymmetricDecrypt(AsymmetricDecryptRequest request, CallSettings callSettings = null)

Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.

Parameters
Name Description
request AsymmetricDecryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AsymmetricDecryptResponse

The RPC response.

Overrides

AsymmetricDecryptAsync(AsymmetricDecryptRequest, CallSettings)

public override Task<AsymmetricDecryptResponse> AsymmetricDecryptAsync(AsymmetricDecryptRequest request, CallSettings callSettings = null)

Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.

Parameters
Name Description
request AsymmetricDecryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAsymmetricDecryptResponse

A Task containing the RPC response.

Overrides

AsymmetricSign(AsymmetricSignRequest, CallSettings)

public override AsymmetricSignResponse AsymmetricSign(AsymmetricSignRequest request, CallSettings callSettings = null)

Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].

Parameters
Name Description
request AsymmetricSignRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AsymmetricSignResponse

The RPC response.

Overrides

AsymmetricSignAsync(AsymmetricSignRequest, CallSettings)

public override Task<AsymmetricSignResponse> AsymmetricSignAsync(AsymmetricSignRequest request, CallSettings callSettings = null)

Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].

Parameters
Name Description
request AsymmetricSignRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAsymmetricSignResponse

A Task containing the RPC response.

Overrides

CreateCryptoKey(CreateCryptoKeyRequest, CallSettings)

public override CryptoKey CreateCryptoKey(CreateCryptoKeyRequest request, CallSettings callSettings = null)

Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.

Parameters
Name Description
request CreateCryptoKeyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKey

The RPC response.

Overrides

CreateCryptoKeyAsync(CreateCryptoKeyRequest, CallSettings)

public override Task<CryptoKey> CreateCryptoKeyAsync(CreateCryptoKeyRequest request, CallSettings callSettings = null)

Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.

Parameters
Name Description
request CreateCryptoKeyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKey

A Task containing the RPC response.

Overrides

CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest, CallSettings)

public override CryptoKeyVersion CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest request, CallSettings callSettings = null)

Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].

The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].

Parameters
Name Description
request CreateCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKeyVersion

The RPC response.

Overrides

CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest, CallSettings)

public override Task<CryptoKeyVersion> CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest request, CallSettings callSettings = null)

Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].

The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].

Parameters
Name Description
request CreateCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKeyVersion

A Task containing the RPC response.

Overrides

CreateImportJob(CreateImportJobRequest, CallSettings)

public override ImportJob CreateImportJob(CreateImportJobRequest request, CallSettings callSettings = null)

Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].

[ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.

Parameters
Name Description
request CreateImportJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ImportJob

The RPC response.

Overrides

CreateImportJobAsync(CreateImportJobRequest, CallSettings)

public override Task<ImportJob> CreateImportJobAsync(CreateImportJobRequest request, CallSettings callSettings = null)

Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].

[ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.

Parameters
Name Description
request CreateImportJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskImportJob

A Task containing the RPC response.

Overrides

CreateKeyRing(CreateKeyRingRequest, CallSettings)

public override KeyRing CreateKeyRing(CreateKeyRingRequest request, CallSettings callSettings = null)

Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.

Parameters
Name Description
request CreateKeyRingRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KeyRing

The RPC response.

Overrides

CreateKeyRingAsync(CreateKeyRingRequest, CallSettings)

public override Task<KeyRing> CreateKeyRingAsync(CreateKeyRingRequest request, CallSettings callSettings = null)

Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.

Parameters
Name Description
request CreateKeyRingRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKeyRing

A Task containing the RPC response.

Overrides

Decrypt(DecryptRequest, CallSettings)

public override DecryptResponse Decrypt(DecryptRequest request, CallSettings callSettings = null)

Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].

Parameters
Name Description
request DecryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DecryptResponse

The RPC response.

Overrides

DecryptAsync(DecryptRequest, CallSettings)

public override Task<DecryptResponse> DecryptAsync(DecryptRequest request, CallSettings callSettings = null)

Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].

Parameters
Name Description
request DecryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskDecryptResponse

A Task containing the RPC response.

Overrides

DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest, CallSettings)

public override CryptoKeyVersion DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request, CallSettings callSettings = null)

Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.

Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to the time [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] in the future. At that time, the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically change to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed.

Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.

Parameters
Name Description
request DestroyCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKeyVersion

The RPC response.

Overrides

DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest, CallSettings)

public override Task<CryptoKeyVersion> DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest request, CallSettings callSettings = null)

Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.

Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to the time [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] in the future. At that time, the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically change to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed.

Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.

Parameters
Name Description
request DestroyCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKeyVersion

A Task containing the RPC response.

Overrides

Encrypt(EncryptRequest, CallSettings)

public override EncryptResponse Encrypt(EncryptRequest request, CallSettings callSettings = null)

Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].

Parameters
Name Description
request EncryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
EncryptResponse

The RPC response.

Overrides

EncryptAsync(EncryptRequest, CallSettings)

public override Task<EncryptResponse> EncryptAsync(EncryptRequest request, CallSettings callSettings = null)

Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].

Parameters
Name Description
request EncryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskEncryptResponse

A Task containing the RPC response.

Overrides

GenerateRandomBytes(GenerateRandomBytesRequest, CallSettings)

public override GenerateRandomBytesResponse GenerateRandomBytes(GenerateRandomBytesRequest request, CallSettings callSettings = null)

Generate random bytes using the Cloud KMS randomness source in the provided location.

Parameters
Name Description
request GenerateRandomBytesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
GenerateRandomBytesResponse

The RPC response.

Overrides

GenerateRandomBytesAsync(GenerateRandomBytesRequest, CallSettings)

public override Task<GenerateRandomBytesResponse> GenerateRandomBytesAsync(GenerateRandomBytesRequest request, CallSettings callSettings = null)

Generate random bytes using the Cloud KMS randomness source in the provided location.

Parameters
Name Description
request GenerateRandomBytesRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGenerateRandomBytesResponse

A Task containing the RPC response.

Overrides

GetCryptoKey(GetCryptoKeyRequest, CallSettings)

public override CryptoKey GetCryptoKey(GetCryptoKeyRequest request, CallSettings callSettings = null)

Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].

Parameters
Name Description
request GetCryptoKeyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKey

The RPC response.

Overrides

GetCryptoKeyAsync(GetCryptoKeyRequest, CallSettings)

public override Task<CryptoKey> GetCryptoKeyAsync(GetCryptoKeyRequest request, CallSettings callSettings = null)

Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].

Parameters
Name Description
request GetCryptoKeyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKey

A Task containing the RPC response.

Overrides

GetCryptoKeyVersion(GetCryptoKeyVersionRequest, CallSettings)

public override CryptoKeyVersion GetCryptoKeyVersion(GetCryptoKeyVersionRequest request, CallSettings callSettings = null)

Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].

Parameters
Name Description
request GetCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKeyVersion

The RPC response.

Overrides

GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest, CallSettings)

public override Task<CryptoKeyVersion> GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest request, CallSettings callSettings = null)

Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].

Parameters
Name Description
request GetCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKeyVersion

A Task containing the RPC response.

Overrides

GetImportJob(GetImportJobRequest, CallSettings)

public override ImportJob GetImportJob(GetImportJobRequest request, CallSettings callSettings = null)

Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].

Parameters
Name Description
request GetImportJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ImportJob

The RPC response.

Overrides

GetImportJobAsync(GetImportJobRequest, CallSettings)

public override Task<ImportJob> GetImportJobAsync(GetImportJobRequest request, CallSettings callSettings = null)

Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].

Parameters
Name Description
request GetImportJobRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskImportJob

A Task containing the RPC response.

Overrides

GetKeyRing(GetKeyRingRequest, CallSettings)

public override KeyRing GetKeyRing(GetKeyRingRequest request, CallSettings callSettings = null)

Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].

Parameters
Name Description
request GetKeyRingRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KeyRing

The RPC response.

Overrides

GetKeyRingAsync(GetKeyRingRequest, CallSettings)

public override Task<KeyRing> GetKeyRingAsync(GetKeyRingRequest request, CallSettings callSettings = null)

Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].

Parameters
Name Description
request GetKeyRingRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKeyRing

A Task containing the RPC response.

Overrides

GetPublicKey(GetPublicKeyRequest, CallSettings)

public override PublicKey GetPublicKey(GetPublicKeyRequest request, CallSettings callSettings = null)

Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].

Parameters
Name Description
request GetPublicKeyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PublicKey

The RPC response.

Overrides

GetPublicKeyAsync(GetPublicKeyRequest, CallSettings)

public override Task<PublicKey> GetPublicKeyAsync(GetPublicKeyRequest request, CallSettings callSettings = null)

Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].

Parameters
Name Description
request GetPublicKeyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPublicKey

A Task containing the RPC response.

Overrides

ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest, CallSettings)

public override CryptoKeyVersion ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest request, CallSettings callSettings = null)

Import wrapped key material into a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].

All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If a [CryptoKeyVersion][google.cloud.kms.v1.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][google.cloud.kms.v1.CryptoKey].

Parameters
Name Description
request ImportCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKeyVersion

The RPC response.

Overrides

ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest, CallSettings)

public override Task<CryptoKeyVersion> ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest request, CallSettings callSettings = null)

Import wrapped key material into a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].

All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If a [CryptoKeyVersion][google.cloud.kms.v1.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][google.cloud.kms.v1.CryptoKey].

Parameters
Name Description
request ImportCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKeyVersion

A Task containing the RPC response.

Overrides

ListCryptoKeyVersions(ListCryptoKeyVersionsRequest, CallSettings)

public override PagedEnumerable<ListCryptoKeyVersionsResponse, CryptoKeyVersion> ListCryptoKeyVersions(ListCryptoKeyVersionsRequest request, CallSettings callSettings = null)

Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].

Parameters
Name Description
request ListCryptoKeyVersionsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion

A pageable sequence of CryptoKeyVersion resources.

Overrides

ListCryptoKeyVersionsAsync(ListCryptoKeyVersionsRequest, CallSettings)

public override PagedAsyncEnumerable<ListCryptoKeyVersionsResponse, CryptoKeyVersion> ListCryptoKeyVersionsAsync(ListCryptoKeyVersionsRequest request, CallSettings callSettings = null)

Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].

Parameters
Name Description
request ListCryptoKeyVersionsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion

A pageable asynchronous sequence of CryptoKeyVersion resources.

Overrides

ListCryptoKeys(ListCryptoKeysRequest, CallSettings)

public override PagedEnumerable<ListCryptoKeysResponse, CryptoKey> ListCryptoKeys(ListCryptoKeysRequest request, CallSettings callSettings = null)

Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].

Parameters
Name Description
request ListCryptoKeysRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListCryptoKeysResponseCryptoKey

A pageable sequence of CryptoKey resources.

Overrides

ListCryptoKeysAsync(ListCryptoKeysRequest, CallSettings)

public override PagedAsyncEnumerable<ListCryptoKeysResponse, CryptoKey> ListCryptoKeysAsync(ListCryptoKeysRequest request, CallSettings callSettings = null)

Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].

Parameters
Name Description
request ListCryptoKeysRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListCryptoKeysResponseCryptoKey

A pageable asynchronous sequence of CryptoKey resources.

Overrides

ListImportJobs(ListImportJobsRequest, CallSettings)

public override PagedEnumerable<ListImportJobsResponse, ImportJob> ListImportJobs(ListImportJobsRequest request, CallSettings callSettings = null)

Lists [ImportJobs][google.cloud.kms.v1.ImportJob].

Parameters
Name Description
request ListImportJobsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListImportJobsResponseImportJob

A pageable sequence of ImportJob resources.

Overrides

ListImportJobsAsync(ListImportJobsRequest, CallSettings)

public override PagedAsyncEnumerable<ListImportJobsResponse, ImportJob> ListImportJobsAsync(ListImportJobsRequest request, CallSettings callSettings = null)

Lists [ImportJobs][google.cloud.kms.v1.ImportJob].

Parameters
Name Description
request ListImportJobsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListImportJobsResponseImportJob

A pageable asynchronous sequence of ImportJob resources.

Overrides

ListKeyRings(ListKeyRingsRequest, CallSettings)

public override PagedEnumerable<ListKeyRingsResponse, KeyRing> ListKeyRings(ListKeyRingsRequest request, CallSettings callSettings = null)

Lists [KeyRings][google.cloud.kms.v1.KeyRing].

Parameters
Name Description
request ListKeyRingsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListKeyRingsResponseKeyRing

A pageable sequence of KeyRing resources.

Overrides

ListKeyRingsAsync(ListKeyRingsRequest, CallSettings)

public override PagedAsyncEnumerable<ListKeyRingsResponse, KeyRing> ListKeyRingsAsync(ListKeyRingsRequest request, CallSettings callSettings = null)

Lists [KeyRings][google.cloud.kms.v1.KeyRing].

Parameters
Name Description
request ListKeyRingsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListKeyRingsResponseKeyRing

A pageable asynchronous sequence of KeyRing resources.

Overrides

MacSign(MacSignRequest, CallSettings)

public override MacSignResponse MacSign(MacSignRequest request, CallSettings callSettings = null)

Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, producing a tag that can be verified by another source with the same key.

Parameters
Name Description
request MacSignRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
MacSignResponse

The RPC response.

Overrides

MacSignAsync(MacSignRequest, CallSettings)

public override Task<MacSignResponse> MacSignAsync(MacSignRequest request, CallSettings callSettings = null)

Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, producing a tag that can be verified by another source with the same key.

Parameters
Name Description
request MacSignRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskMacSignResponse

A Task containing the RPC response.

Overrides

MacVerify(MacVerifyRequest, CallSettings)

public override MacVerifyResponse MacVerify(MacVerifyRequest request, CallSettings callSettings = null)

Verifies MAC tag using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns a response that indicates whether or not the verification was successful.

Parameters
Name Description
request MacVerifyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
MacVerifyResponse

The RPC response.

Overrides

MacVerifyAsync(MacVerifyRequest, CallSettings)

public override Task<MacVerifyResponse> MacVerifyAsync(MacVerifyRequest request, CallSettings callSettings = null)

Verifies MAC tag using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns a response that indicates whether or not the verification was successful.

Parameters
Name Description
request MacVerifyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskMacVerifyResponse

A Task containing the RPC response.

Overrides

RawDecrypt(RawDecryptRequest, CallSettings)

public override RawDecryptResponse RawDecrypt(RawDecryptRequest request, CallSettings callSettings = null)

Decrypts data that was originally encrypted using a raw cryptographic mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT].

Parameters
Name Description
request RawDecryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RawDecryptResponse

The RPC response.

Overrides

RawDecryptAsync(RawDecryptRequest, CallSettings)

public override Task<RawDecryptResponse> RawDecryptAsync(RawDecryptRequest request, CallSettings callSettings = null)

Decrypts data that was originally encrypted using a raw cryptographic mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT].

Parameters
Name Description
request RawDecryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskRawDecryptResponse

A Task containing the RPC response.

Overrides

RawEncrypt(RawEncryptRequest, CallSettings)

public override RawEncryptResponse RawEncrypt(RawEncryptRequest request, CallSettings callSettings = null)

Encrypts data using portable cryptographic primitives. Most users should choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than their raw counterparts. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT].

Parameters
Name Description
request RawEncryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RawEncryptResponse

The RPC response.

Overrides

RawEncryptAsync(RawEncryptRequest, CallSettings)

public override Task<RawEncryptResponse> RawEncryptAsync(RawEncryptRequest request, CallSettings callSettings = null)

Encrypts data using portable cryptographic primitives. Most users should choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than their raw counterparts. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT].

Parameters
Name Description
request RawEncryptRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskRawEncryptResponse

A Task containing the RPC response.

Overrides

RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest, CallSettings)

public override CryptoKeyVersion RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request, CallSettings callSettings = null)

Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state.

Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.

Parameters
Name Description
request RestoreCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKeyVersion

The RPC response.

Overrides

RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest, CallSettings)

public override Task<CryptoKeyVersion> RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest request, CallSettings callSettings = null)

Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state.

Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.

Parameters
Name Description
request RestoreCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKeyVersion

A Task containing the RPC response.

Overrides

UpdateCryptoKey(UpdateCryptoKeyRequest, CallSettings)

public override CryptoKey UpdateCryptoKey(UpdateCryptoKeyRequest request, CallSettings callSettings = null)

Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].

Parameters
Name Description
request UpdateCryptoKeyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKey

The RPC response.

Overrides

UpdateCryptoKeyAsync(UpdateCryptoKeyRequest, CallSettings)

public override Task<CryptoKey> UpdateCryptoKeyAsync(UpdateCryptoKeyRequest request, CallSettings callSettings = null)

Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].

Parameters
Name Description
request UpdateCryptoKeyRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKey

A Task containing the RPC response.

Overrides

UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest, CallSettings)

public override CryptoKey UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request, CallSettings callSettings = null)

Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].

Returns an error if called on a key whose purpose is not [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].

Parameters
Name Description
request UpdateCryptoKeyPrimaryVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKey

The RPC response.

Overrides

UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest, CallSettings)

public override Task<CryptoKey> UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest request, CallSettings callSettings = null)

Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].

Returns an error if called on a key whose purpose is not [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].

Parameters
Name Description
request UpdateCryptoKeyPrimaryVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKey

A Task containing the RPC response.

Overrides

UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest, CallSettings)

public override CryptoKeyVersion UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request, CallSettings callSettings = null)

Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata.

[state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to move between other states.

Parameters
Name Description
request UpdateCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CryptoKeyVersion

The RPC response.

Overrides

UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest, CallSettings)

public override Task<CryptoKeyVersion> UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest request, CallSettings callSettings = null)

Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata.

[state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to move between other states.

Parameters
Name Description
request UpdateCryptoKeyVersionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCryptoKeyVersion

A Task containing the RPC response.

Overrides