Google Cloud Key Management Service v1 API - Class KeyManagementService.KeyManagementServiceClient (3.12.0)

public class KeyManagementService.KeyManagementServiceClient : ClientBase<KeyManagementService.KeyManagementServiceClient>

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

Client for KeyManagementService

Inheritance

object > ClientBase > ClientBaseKeyManagementServiceKeyManagementServiceClient > KeyManagementService.KeyManagementServiceClient

Namespace

Google.Cloud.Kms.V1

Assembly

Google.Cloud.Kms.V1.dll

Constructors

KeyManagementServiceClient()

protected KeyManagementServiceClient()

Protected parameterless constructor to allow creation of test doubles.

KeyManagementServiceClient(CallInvoker)

public KeyManagementServiceClient(CallInvoker callInvoker)

Creates a new client for KeyManagementService that uses a custom CallInvoker.

Parameter
Name Description
callInvoker CallInvoker

The callInvoker to use to make remote calls.

KeyManagementServiceClient(ChannelBase)

public KeyManagementServiceClient(ChannelBase channel)

Creates a new client for KeyManagementService

Parameter
Name Description
channel ChannelBase

The channel to use to make remote calls.

KeyManagementServiceClient(ClientBaseConfiguration)

protected KeyManagementServiceClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration

The client configuration.

Methods

AsymmetricDecrypt(AsymmetricDecryptRequest, CallOptions)

public virtual AsymmetricDecryptResponse AsymmetricDecrypt(AsymmetricDecryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsymmetricDecryptResponse

The response received from the server.

AsymmetricDecrypt(AsymmetricDecryptRequest, Metadata, DateTime?, CancellationToken)

public virtual AsymmetricDecryptResponse AsymmetricDecrypt(AsymmetricDecryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsymmetricDecryptResponse

The response received from the server.

AsymmetricDecryptAsync(AsymmetricDecryptRequest, CallOptions)

public virtual AsyncUnaryCall<AsymmetricDecryptResponse> AsymmetricDecryptAsync(AsymmetricDecryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallAsymmetricDecryptResponse

The call object.

AsymmetricDecryptAsync(AsymmetricDecryptRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<AsymmetricDecryptResponse> AsymmetricDecryptAsync(AsymmetricDecryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallAsymmetricDecryptResponse

The call object.

AsymmetricSign(AsymmetricSignRequest, CallOptions)

public virtual AsymmetricSignResponse AsymmetricSign(AsymmetricSignRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsymmetricSignResponse

The response received from the server.

AsymmetricSign(AsymmetricSignRequest, Metadata, DateTime?, CancellationToken)

public virtual AsymmetricSignResponse AsymmetricSign(AsymmetricSignRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsymmetricSignResponse

The response received from the server.

AsymmetricSignAsync(AsymmetricSignRequest, CallOptions)

public virtual AsyncUnaryCall<AsymmetricSignResponse> AsymmetricSignAsync(AsymmetricSignRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallAsymmetricSignResponse

The call object.

AsymmetricSignAsync(AsymmetricSignRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<AsymmetricSignResponse> AsymmetricSignAsync(AsymmetricSignRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallAsymmetricSignResponse

The call object.

CreateCryptoKey(CreateCryptoKeyRequest, CallOptions)

public virtual CryptoKey CreateCryptoKey(CreateCryptoKeyRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKey

The response received from the server.

CreateCryptoKey(CreateCryptoKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKey CreateCryptoKey(CreateCryptoKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKey

The response received from the server.

CreateCryptoKeyAsync(CreateCryptoKeyRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKey> CreateCryptoKeyAsync(CreateCryptoKeyRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKey

The call object.

CreateCryptoKeyAsync(CreateCryptoKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKey> CreateCryptoKeyAsync(CreateCryptoKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKey

The call object.

CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest, CallOptions)

public virtual CryptoKeyVersion CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKeyVersion CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKeyVersion> CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKeyVersion> CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

CreateIAMPolicyClient()

public virtual IAMPolicy.IAMPolicyClient CreateIAMPolicyClient()

Creates a new instance of IAMPolicy.IAMPolicyClient using the same call invoker as this client.

Returns
Type Description
IAMPolicyIAMPolicyClient

A new IAMPolicy.IAMPolicyClient for the same target as this client.

CreateImportJob(CreateImportJobRequest, CallOptions)

public virtual ImportJob CreateImportJob(CreateImportJobRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ImportJob

The response received from the server.

CreateImportJob(CreateImportJobRequest, Metadata, DateTime?, CancellationToken)

public virtual ImportJob CreateImportJob(CreateImportJobRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ImportJob

The response received from the server.

CreateImportJobAsync(CreateImportJobRequest, CallOptions)

public virtual AsyncUnaryCall<ImportJob> CreateImportJobAsync(CreateImportJobRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallImportJob

The call object.

CreateImportJobAsync(CreateImportJobRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ImportJob> CreateImportJobAsync(CreateImportJobRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallImportJob

The call object.

CreateKeyRing(CreateKeyRingRequest, CallOptions)

public virtual KeyRing CreateKeyRing(CreateKeyRingRequest request, CallOptions options)

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

Parameters
Name Description
request CreateKeyRingRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
KeyRing

The response received from the server.

CreateKeyRing(CreateKeyRingRequest, Metadata, DateTime?, CancellationToken)

public virtual KeyRing CreateKeyRing(CreateKeyRingRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request CreateKeyRingRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
KeyRing

The response received from the server.

CreateKeyRingAsync(CreateKeyRingRequest, CallOptions)

public virtual AsyncUnaryCall<KeyRing> CreateKeyRingAsync(CreateKeyRingRequest request, CallOptions options)

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

Parameters
Name Description
request CreateKeyRingRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallKeyRing

The call object.

CreateKeyRingAsync(CreateKeyRingRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<KeyRing> CreateKeyRingAsync(CreateKeyRingRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request CreateKeyRingRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallKeyRing

The call object.

CreateLocationsClient()

public virtual Locations.LocationsClient CreateLocationsClient()

Creates a new instance of Locations.LocationsClient using the same call invoker as this client.

Returns
Type Description
LocationsLocationsClient

A new Locations.LocationsClient for the same target as this client.

Decrypt(DecryptRequest, CallOptions)

public virtual DecryptResponse Decrypt(DecryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
DecryptResponse

The response received from the server.

Decrypt(DecryptRequest, Metadata, DateTime?, CancellationToken)

public virtual DecryptResponse Decrypt(DecryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
DecryptResponse

The response received from the server.

DecryptAsync(DecryptRequest, CallOptions)

public virtual AsyncUnaryCall<DecryptResponse> DecryptAsync(DecryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallDecryptResponse

The call object.

DecryptAsync(DecryptRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<DecryptResponse> DecryptAsync(DecryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallDecryptResponse

The call object.

DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest, CallOptions)

public virtual CryptoKeyVersion DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKeyVersion DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKeyVersion> DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKeyVersion> DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

Encrypt(EncryptRequest, CallOptions)

public virtual EncryptResponse Encrypt(EncryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
EncryptResponse

The response received from the server.

Encrypt(EncryptRequest, Metadata, DateTime?, CancellationToken)

public virtual EncryptResponse Encrypt(EncryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
EncryptResponse

The response received from the server.

EncryptAsync(EncryptRequest, CallOptions)

public virtual AsyncUnaryCall<EncryptResponse> EncryptAsync(EncryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEncryptResponse

The call object.

EncryptAsync(EncryptRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<EncryptResponse> EncryptAsync(EncryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEncryptResponse

The call object.

GenerateRandomBytes(GenerateRandomBytesRequest, CallOptions)

public virtual GenerateRandomBytesResponse GenerateRandomBytes(GenerateRandomBytesRequest request, CallOptions options)

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

Parameters
Name Description
request GenerateRandomBytesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
GenerateRandomBytesResponse

The response received from the server.

GenerateRandomBytes(GenerateRandomBytesRequest, Metadata, DateTime?, CancellationToken)

public virtual GenerateRandomBytesResponse GenerateRandomBytes(GenerateRandomBytesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GenerateRandomBytesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
GenerateRandomBytesResponse

The response received from the server.

GenerateRandomBytesAsync(GenerateRandomBytesRequest, CallOptions)

public virtual AsyncUnaryCall<GenerateRandomBytesResponse> GenerateRandomBytesAsync(GenerateRandomBytesRequest request, CallOptions options)

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

Parameters
Name Description
request GenerateRandomBytesRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallGenerateRandomBytesResponse

The call object.

GenerateRandomBytesAsync(GenerateRandomBytesRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<GenerateRandomBytesResponse> GenerateRandomBytesAsync(GenerateRandomBytesRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GenerateRandomBytesRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallGenerateRandomBytesResponse

The call object.

GetCryptoKey(GetCryptoKeyRequest, CallOptions)

public virtual CryptoKey GetCryptoKey(GetCryptoKeyRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKey

The response received from the server.

GetCryptoKey(GetCryptoKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKey GetCryptoKey(GetCryptoKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKey

The response received from the server.

GetCryptoKeyAsync(GetCryptoKeyRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKey> GetCryptoKeyAsync(GetCryptoKeyRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKey

The call object.

GetCryptoKeyAsync(GetCryptoKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKey> GetCryptoKeyAsync(GetCryptoKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKey

The call object.

GetCryptoKeyVersion(GetCryptoKeyVersionRequest, CallOptions)

public virtual CryptoKeyVersion GetCryptoKeyVersion(GetCryptoKeyVersionRequest request, CallOptions options)

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

Parameters
Name Description
request GetCryptoKeyVersionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

GetCryptoKeyVersion(GetCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKeyVersion GetCryptoKeyVersion(GetCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetCryptoKeyVersionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKeyVersion> GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest request, CallOptions options)

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

Parameters
Name Description
request GetCryptoKeyVersionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKeyVersion> GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetCryptoKeyVersionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

GetImportJob(GetImportJobRequest, CallOptions)

public virtual ImportJob GetImportJob(GetImportJobRequest request, CallOptions options)

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

Parameters
Name Description
request GetImportJobRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ImportJob

The response received from the server.

GetImportJob(GetImportJobRequest, Metadata, DateTime?, CancellationToken)

public virtual ImportJob GetImportJob(GetImportJobRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetImportJobRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ImportJob

The response received from the server.

GetImportJobAsync(GetImportJobRequest, CallOptions)

public virtual AsyncUnaryCall<ImportJob> GetImportJobAsync(GetImportJobRequest request, CallOptions options)

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

Parameters
Name Description
request GetImportJobRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallImportJob

The call object.

GetImportJobAsync(GetImportJobRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ImportJob> GetImportJobAsync(GetImportJobRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetImportJobRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallImportJob

The call object.

GetKeyRing(GetKeyRingRequest, CallOptions)

public virtual KeyRing GetKeyRing(GetKeyRingRequest request, CallOptions options)

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

Parameters
Name Description
request GetKeyRingRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
KeyRing

The response received from the server.

GetKeyRing(GetKeyRingRequest, Metadata, DateTime?, CancellationToken)

public virtual KeyRing GetKeyRing(GetKeyRingRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetKeyRingRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
KeyRing

The response received from the server.

GetKeyRingAsync(GetKeyRingRequest, CallOptions)

public virtual AsyncUnaryCall<KeyRing> GetKeyRingAsync(GetKeyRingRequest request, CallOptions options)

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

Parameters
Name Description
request GetKeyRingRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallKeyRing

The call object.

GetKeyRingAsync(GetKeyRingRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<KeyRing> GetKeyRingAsync(GetKeyRingRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request GetKeyRingRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallKeyRing

The call object.

GetPublicKey(GetPublicKeyRequest, CallOptions)

public virtual PublicKey GetPublicKey(GetPublicKeyRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
PublicKey

The response received from the server.

GetPublicKey(GetPublicKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual PublicKey GetPublicKey(GetPublicKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
PublicKey

The response received from the server.

GetPublicKeyAsync(GetPublicKeyRequest, CallOptions)

public virtual AsyncUnaryCall<PublicKey> GetPublicKeyAsync(GetPublicKeyRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallPublicKey

The call object.

GetPublicKeyAsync(GetPublicKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<PublicKey> GetPublicKeyAsync(GetPublicKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallPublicKey

The call object.

ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest, CallOptions)

public virtual CryptoKeyVersion ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKeyVersion ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKeyVersion> ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKeyVersion> ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

ListCryptoKeyVersions(ListCryptoKeyVersionsRequest, CallOptions)

public virtual ListCryptoKeyVersionsResponse ListCryptoKeyVersions(ListCryptoKeyVersionsRequest request, CallOptions options)

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

Parameters
Name Description
request ListCryptoKeyVersionsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListCryptoKeyVersionsResponse

The response received from the server.

ListCryptoKeyVersions(ListCryptoKeyVersionsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListCryptoKeyVersionsResponse ListCryptoKeyVersions(ListCryptoKeyVersionsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListCryptoKeyVersionsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListCryptoKeyVersionsResponse

The response received from the server.

ListCryptoKeyVersionsAsync(ListCryptoKeyVersionsRequest, CallOptions)

public virtual AsyncUnaryCall<ListCryptoKeyVersionsResponse> ListCryptoKeyVersionsAsync(ListCryptoKeyVersionsRequest request, CallOptions options)

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

Parameters
Name Description
request ListCryptoKeyVersionsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListCryptoKeyVersionsResponse

The call object.

ListCryptoKeyVersionsAsync(ListCryptoKeyVersionsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListCryptoKeyVersionsResponse> ListCryptoKeyVersionsAsync(ListCryptoKeyVersionsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListCryptoKeyVersionsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListCryptoKeyVersionsResponse

The call object.

ListCryptoKeys(ListCryptoKeysRequest, CallOptions)

public virtual ListCryptoKeysResponse ListCryptoKeys(ListCryptoKeysRequest request, CallOptions options)

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

Parameters
Name Description
request ListCryptoKeysRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListCryptoKeysResponse

The response received from the server.

ListCryptoKeys(ListCryptoKeysRequest, Metadata, DateTime?, CancellationToken)

public virtual ListCryptoKeysResponse ListCryptoKeys(ListCryptoKeysRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListCryptoKeysRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListCryptoKeysResponse

The response received from the server.

ListCryptoKeysAsync(ListCryptoKeysRequest, CallOptions)

public virtual AsyncUnaryCall<ListCryptoKeysResponse> ListCryptoKeysAsync(ListCryptoKeysRequest request, CallOptions options)

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

Parameters
Name Description
request ListCryptoKeysRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListCryptoKeysResponse

The call object.

ListCryptoKeysAsync(ListCryptoKeysRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListCryptoKeysResponse> ListCryptoKeysAsync(ListCryptoKeysRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListCryptoKeysRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListCryptoKeysResponse

The call object.

ListImportJobs(ListImportJobsRequest, CallOptions)

public virtual ListImportJobsResponse ListImportJobs(ListImportJobsRequest request, CallOptions options)

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

Parameters
Name Description
request ListImportJobsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListImportJobsResponse

The response received from the server.

ListImportJobs(ListImportJobsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListImportJobsResponse ListImportJobs(ListImportJobsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListImportJobsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListImportJobsResponse

The response received from the server.

ListImportJobsAsync(ListImportJobsRequest, CallOptions)

public virtual AsyncUnaryCall<ListImportJobsResponse> ListImportJobsAsync(ListImportJobsRequest request, CallOptions options)

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

Parameters
Name Description
request ListImportJobsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListImportJobsResponse

The call object.

ListImportJobsAsync(ListImportJobsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListImportJobsResponse> ListImportJobsAsync(ListImportJobsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListImportJobsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListImportJobsResponse

The call object.

ListKeyRings(ListKeyRingsRequest, CallOptions)

public virtual ListKeyRingsResponse ListKeyRings(ListKeyRingsRequest request, CallOptions options)

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

Parameters
Name Description
request ListKeyRingsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListKeyRingsResponse

The response received from the server.

ListKeyRings(ListKeyRingsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListKeyRingsResponse ListKeyRings(ListKeyRingsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListKeyRingsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListKeyRingsResponse

The response received from the server.

ListKeyRingsAsync(ListKeyRingsRequest, CallOptions)

public virtual AsyncUnaryCall<ListKeyRingsResponse> ListKeyRingsAsync(ListKeyRingsRequest request, CallOptions options)

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

Parameters
Name Description
request ListKeyRingsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListKeyRingsResponse

The call object.

ListKeyRingsAsync(ListKeyRingsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListKeyRingsResponse> ListKeyRingsAsync(ListKeyRingsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request ListKeyRingsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListKeyRingsResponse

The call object.

MacSign(MacSignRequest, CallOptions)

public virtual MacSignResponse MacSign(MacSignRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
MacSignResponse

The response received from the server.

MacSign(MacSignRequest, Metadata, DateTime?, CancellationToken)

public virtual MacSignResponse MacSign(MacSignRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
MacSignResponse

The response received from the server.

MacSignAsync(MacSignRequest, CallOptions)

public virtual AsyncUnaryCall<MacSignResponse> MacSignAsync(MacSignRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallMacSignResponse

The call object.

MacSignAsync(MacSignRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<MacSignResponse> MacSignAsync(MacSignRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallMacSignResponse

The call object.

MacVerify(MacVerifyRequest, CallOptions)

public virtual MacVerifyResponse MacVerify(MacVerifyRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
MacVerifyResponse

The response received from the server.

MacVerify(MacVerifyRequest, Metadata, DateTime?, CancellationToken)

public virtual MacVerifyResponse MacVerify(MacVerifyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
MacVerifyResponse

The response received from the server.

MacVerifyAsync(MacVerifyRequest, CallOptions)

public virtual AsyncUnaryCall<MacVerifyResponse> MacVerifyAsync(MacVerifyRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallMacVerifyResponse

The call object.

MacVerifyAsync(MacVerifyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<MacVerifyResponse> MacVerifyAsync(MacVerifyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallMacVerifyResponse

The call object.

NewInstance(ClientBaseConfiguration)

protected override KeyManagementService.KeyManagementServiceClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration
Returns
Type Description
KeyManagementServiceKeyManagementServiceClient
Overrides

RawDecrypt(RawDecryptRequest, CallOptions)

public virtual RawDecryptResponse RawDecrypt(RawDecryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
RawDecryptResponse

The response received from the server.

RawDecrypt(RawDecryptRequest, Metadata, DateTime?, CancellationToken)

public virtual RawDecryptResponse RawDecrypt(RawDecryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
RawDecryptResponse

The response received from the server.

RawDecryptAsync(RawDecryptRequest, CallOptions)

public virtual AsyncUnaryCall<RawDecryptResponse> RawDecryptAsync(RawDecryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallRawDecryptResponse

The call object.

RawDecryptAsync(RawDecryptRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<RawDecryptResponse> RawDecryptAsync(RawDecryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallRawDecryptResponse

The call object.

RawEncrypt(RawEncryptRequest, CallOptions)

public virtual RawEncryptResponse RawEncrypt(RawEncryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
RawEncryptResponse

The response received from the server.

RawEncrypt(RawEncryptRequest, Metadata, DateTime?, CancellationToken)

public virtual RawEncryptResponse RawEncrypt(RawEncryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
RawEncryptResponse

The response received from the server.

RawEncryptAsync(RawEncryptRequest, CallOptions)

public virtual AsyncUnaryCall<RawEncryptResponse> RawEncryptAsync(RawEncryptRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallRawEncryptResponse

The call object.

RawEncryptAsync(RawEncryptRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<RawEncryptResponse> RawEncryptAsync(RawEncryptRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallRawEncryptResponse

The call object.

RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest, CallOptions)

public virtual CryptoKeyVersion RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKeyVersion RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKeyVersion> RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKeyVersion> RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

UpdateCryptoKey(UpdateCryptoKeyRequest, CallOptions)

public virtual CryptoKey UpdateCryptoKey(UpdateCryptoKeyRequest request, CallOptions options)

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

Parameters
Name Description
request UpdateCryptoKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKey

The response received from the server.

UpdateCryptoKey(UpdateCryptoKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKey UpdateCryptoKey(UpdateCryptoKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request UpdateCryptoKeyRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKey

The response received from the server.

UpdateCryptoKeyAsync(UpdateCryptoKeyRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKey> UpdateCryptoKeyAsync(UpdateCryptoKeyRequest request, CallOptions options)

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

Parameters
Name Description
request UpdateCryptoKeyRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKey

The call object.

UpdateCryptoKeyAsync(UpdateCryptoKeyRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKey> UpdateCryptoKeyAsync(UpdateCryptoKeyRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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

Parameters
Name Description
request UpdateCryptoKeyRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKey

The call object.

UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest, CallOptions)

public virtual CryptoKey UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKey

The response received from the server.

UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKey UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKey

The response received from the server.

UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKey> UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKey

The call object.

UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKey> UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKey

The call object.

UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest, CallOptions)

public virtual CryptoKeyVersion UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual CryptoKeyVersion UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
CryptoKeyVersion

The response received from the server.

UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest, CallOptions)

public virtual AsyncUnaryCall<CryptoKeyVersion> UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.

UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<CryptoKeyVersion> UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallCryptoKeyVersion

The call object.