Google Cloud Key Management Service v1 API - Class KeyManagementServiceClientImpl (3.4.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

GoogleGoogle.CloudGoogle.Cloud.KmsV1

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
NameDescription
grpcClientKeyManagementServiceKeyManagementServiceClient

The underlying gRPC client.

settingsKeyManagementServiceSettings

The base KeyManagementServiceSettings used within this client.

loggerILogger

Optional ILogger to use within this client.

Properties

GrpcClient

public override KeyManagementService.KeyManagementServiceClient GrpcClient { get; }

The underlying gRPC KeyManagementService client

Property Value
TypeDescription
KeyManagementServiceKeyManagementServiceClient
Overrides

IAMPolicyClient

public override IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
TypeDescription
IAMPolicyClient
Overrides

LocationsClient

public override LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
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
NameDescription
requestAsymmetricDecryptRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestAsymmetricDecryptRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestAsymmetricSignRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestAsymmetricSignRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateCryptoKeyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateCryptoKeyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateImportJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateImportJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateKeyRingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateKeyRingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDecryptRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDecryptRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDestroyCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDestroyCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestEncryptRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestEncryptRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGenerateRandomBytesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGenerateRandomBytesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetCryptoKeyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetCryptoKeyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetImportJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetImportJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetKeyRingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetKeyRingRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetPublicKeyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetPublicKeyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestImportCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestImportCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskCryptoKeyVersion

A Task containing the RPC response.

Overrides

ListCryptoKeys(ListCryptoKeysRequest, CallSettings)

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

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

Parameters
NameDescription
requestListCryptoKeysRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListCryptoKeysRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListCryptoKeysResponseCryptoKey

A pageable asynchronous sequence of CryptoKey resources.

Overrides

ListCryptoKeyVersions(ListCryptoKeyVersionsRequest, CallSettings)

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

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

Parameters
NameDescription
requestListCryptoKeyVersionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListCryptoKeyVersionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion

A pageable asynchronous sequence of CryptoKeyVersion resources.

Overrides

ListImportJobs(ListImportJobsRequest, CallSettings)

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

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

Parameters
NameDescription
requestListImportJobsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListImportJobsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListKeyRingsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListKeyRingsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestMacSignRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestMacSignRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestMacVerifyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestMacVerifyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskMacVerifyResponse

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
NameDescription
requestRestoreCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestRestoreCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestUpdateCryptoKeyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestUpdateCryptoKeyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestUpdateCryptoKeyPrimaryVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestUpdateCryptoKeyPrimaryVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestUpdateCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestUpdateCryptoKeyVersionRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskCryptoKeyVersion

A Task containing the RPC response.

Overrides