public abstract class KeyManagementServiceClientReference documentation and code samples for the Google Cloud Key Management Service v1 API class KeyManagementServiceClient.
KeyManagementService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Kms.V1Assembly
Google.Cloud.Kms.V1.dll
Remarks
Google Cloud Key Management Service
Manages cryptographic keys and operations using those keys. Implements a REST model with the following objects:
- [KeyRing][google.cloud.kms.v1.KeyRing]
- [CryptoKey][google.cloud.kms.v1.CryptoKey]
- [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
- [ImportJob][google.cloud.kms.v1.ImportJob]
If you are using manual gRPC libraries, see Using gRPC with Cloud KMS.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }The default endpoint for the KeyManagementService service, which is a host of "cloudkms.googleapis.com" and a port of 443.
| Property Value | |
|---|---|
| Type | Description |
string |
|
DefaultScopes
public static IReadOnlyList DefaultScopes { get; } The default KeyManagementService scopes.
| Property Value | |
|---|---|
| Type | Description |
IReadOnlyListstring |
|
The default KeyManagementService scopes are:
DeleteCryptoKeyOperationsClient
public virtual OperationsClient DeleteCryptoKeyOperationsClient { get; }The long-running operations client for DeleteCryptoKey.
| Property Value | |
|---|---|
| Type | Description |
OperationsClient |
|
DeleteCryptoKeyVersionOperationsClient
public virtual OperationsClient DeleteCryptoKeyVersionOperationsClient { get; }The long-running operations client for DeleteCryptoKeyVersion.
| Property Value | |
|---|---|
| Type | Description |
OperationsClient |
|
GrpcClient
public virtual KeyManagementService.KeyManagementServiceClient GrpcClient { get; }The underlying gRPC KeyManagementService client
| Property Value | |
|---|---|
| Type | Description |
KeyManagementServiceKeyManagementServiceClient |
|
IAMPolicyClient
public virtual IAMPolicyClient IAMPolicyClient { get; }The IAMPolicyClient associated with this client.
| Property Value | |
|---|---|
| Type | Description |
IAMPolicyClient |
|
LocationsClient
public virtual LocationsClient LocationsClient { get; }The LocationsClient associated with this client.
| Property Value | |
|---|---|
| Type | Description |
LocationsClient |
|
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }The service metadata associated with this client type.
| Property Value | |
|---|---|
| Type | Description |
ServiceMetadata |
|
Methods
AsymmetricDecrypt(AsymmetricDecryptRequest, CallSettings)
public virtual AsymmetricDecryptResponse AsymmetricDecrypt(AsymmetricDecryptRequest request, CallSettings callSettings = null)Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
| Parameters | |
|---|---|
| Name | Description |
request |
AsymmetricDecryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
AsymmetricDecryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
AsymmetricDecryptRequest request = new AsymmetricDecryptRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Ciphertext = ByteString.Empty,
CiphertextCrc32C = 0L,
};
// Make the request
AsymmetricDecryptResponse response = keyManagementServiceClient.AsymmetricDecrypt(request);
AsymmetricDecrypt(CryptoKeyVersionName, ByteString, CallSettings)
public virtual AsymmetricDecryptResponse AsymmetricDecrypt(CryptoKeyVersionName name, ByteString ciphertext, CallSettings callSettings = null)Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for decryption. |
ciphertext |
ByteStringRequired. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using OAEP. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
AsymmetricDecryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString ciphertext = ByteString.Empty;
// Make the request
AsymmetricDecryptResponse response = keyManagementServiceClient.AsymmetricDecrypt(name, ciphertext);
AsymmetricDecrypt(string, ByteString, CallSettings)
public virtual AsymmetricDecryptResponse AsymmetricDecrypt(string name, ByteString ciphertext, CallSettings callSettings = null)Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for decryption. |
ciphertext |
ByteStringRequired. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using OAEP. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
AsymmetricDecryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString ciphertext = ByteString.Empty;
// Make the request
AsymmetricDecryptResponse response = keyManagementServiceClient.AsymmetricDecrypt(name, ciphertext);
AsymmetricDecryptAsync(AsymmetricDecryptRequest, CallSettings)
public virtual Task AsymmetricDecryptAsync(AsymmetricDecryptRequest request, CallSettings callSettings = null) Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
| Parameters | |
|---|---|
| Name | Description |
request |
AsymmetricDecryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
AsymmetricDecryptRequest request = new AsymmetricDecryptRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Ciphertext = ByteString.Empty,
CiphertextCrc32C = 0L,
};
// Make the request
AsymmetricDecryptResponse response = await keyManagementServiceClient.AsymmetricDecryptAsync(request);
AsymmetricDecryptAsync(AsymmetricDecryptRequest, CancellationToken)
public virtual Task AsymmetricDecryptAsync(AsymmetricDecryptRequest request, CancellationToken cancellationToken) 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 |
AsymmetricDecryptRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
AsymmetricDecryptRequest request = new AsymmetricDecryptRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Ciphertext = ByteString.Empty,
CiphertextCrc32C = 0L,
};
// Make the request
AsymmetricDecryptResponse response = await keyManagementServiceClient.AsymmetricDecryptAsync(request);
AsymmetricDecryptAsync(CryptoKeyVersionName, ByteString, CallSettings)
public virtual Task AsymmetricDecryptAsync(CryptoKeyVersionName name, ByteString ciphertext, CallSettings callSettings = null) Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for decryption. |
ciphertext |
ByteStringRequired. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using OAEP. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString ciphertext = ByteString.Empty;
// Make the request
AsymmetricDecryptResponse response = await keyManagementServiceClient.AsymmetricDecryptAsync(name, ciphertext);
AsymmetricDecryptAsync(CryptoKeyVersionName, ByteString, CancellationToken)
public virtual Task AsymmetricDecryptAsync(CryptoKeyVersionName name, ByteString ciphertext, CancellationToken cancellationToken) 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 |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for decryption. |
ciphertext |
ByteStringRequired. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using OAEP. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString ciphertext = ByteString.Empty;
// Make the request
AsymmetricDecryptResponse response = await keyManagementServiceClient.AsymmetricDecryptAsync(name, ciphertext);
AsymmetricDecryptAsync(string, ByteString, CallSettings)
public virtual Task AsymmetricDecryptAsync(string name, ByteString ciphertext, CallSettings callSettings = null) Decrypts data that was encrypted with a public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for decryption. |
ciphertext |
ByteStringRequired. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using OAEP. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString ciphertext = ByteString.Empty;
// Make the request
AsymmetricDecryptResponse response = await keyManagementServiceClient.AsymmetricDecryptAsync(name, ciphertext);
AsymmetricDecryptAsync(string, ByteString, CancellationToken)
public virtual Task AsymmetricDecryptAsync(string name, ByteString ciphertext, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for decryption. |
ciphertext |
ByteStringRequired. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using OAEP. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString ciphertext = ByteString.Empty;
// Make the request
AsymmetricDecryptResponse response = await keyManagementServiceClient.AsymmetricDecryptAsync(name, ciphertext);
AsymmetricSign(AsymmetricSignRequest, CallSettings)
public virtual AsymmetricSignResponse AsymmetricSign(AsymmetricSignRequest request, CallSettings callSettings = null)Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
| Parameters | |
|---|---|
| Name | Description |
request |
AsymmetricSignRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
AsymmetricSignResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
AsymmetricSignRequest request = new AsymmetricSignRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Digest = new Digest(),
DigestCrc32C = 0L,
Data = ByteString.Empty,
DataCrc32C = 0L,
};
// Make the request
AsymmetricSignResponse response = keyManagementServiceClient.AsymmetricSign(request);
AsymmetricSign(CryptoKeyVersionName, Digest, CallSettings)
public virtual AsymmetricSignResponse AsymmetricSign(CryptoKeyVersionName name, Digest digest, CallSettings callSettings = null)Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
digest |
DigestOptional. The digest of the data to sign. The digest must be produced with the same digest algorithm as specified by the key version's [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. This field may not be supplied if [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
AsymmetricSignResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
Digest digest = new Digest();
// Make the request
AsymmetricSignResponse response = keyManagementServiceClient.AsymmetricSign(name, digest);
AsymmetricSign(string, Digest, CallSettings)
public virtual AsymmetricSignResponse AsymmetricSign(string name, Digest digest, CallSettings callSettings = null)Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
digest |
DigestOptional. The digest of the data to sign. The digest must be produced with the same digest algorithm as specified by the key version's [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. This field may not be supplied if [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
AsymmetricSignResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
Digest digest = new Digest();
// Make the request
AsymmetricSignResponse response = keyManagementServiceClient.AsymmetricSign(name, digest);
AsymmetricSignAsync(AsymmetricSignRequest, CallSettings)
public virtual Task AsymmetricSignAsync(AsymmetricSignRequest request, CallSettings callSettings = null) Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
| Parameters | |
|---|---|
| Name | Description |
request |
AsymmetricSignRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
AsymmetricSignRequest request = new AsymmetricSignRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Digest = new Digest(),
DigestCrc32C = 0L,
Data = ByteString.Empty,
DataCrc32C = 0L,
};
// Make the request
AsymmetricSignResponse response = await keyManagementServiceClient.AsymmetricSignAsync(request);
AsymmetricSignAsync(AsymmetricSignRequest, CancellationToken)
public virtual Task AsymmetricSignAsync(AsymmetricSignRequest request, CancellationToken cancellationToken) 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 |
AsymmetricSignRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
AsymmetricSignRequest request = new AsymmetricSignRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Digest = new Digest(),
DigestCrc32C = 0L,
Data = ByteString.Empty,
DataCrc32C = 0L,
};
// Make the request
AsymmetricSignResponse response = await keyManagementServiceClient.AsymmetricSignAsync(request);
AsymmetricSignAsync(CryptoKeyVersionName, Digest, CallSettings)
public virtual Task AsymmetricSignAsync(CryptoKeyVersionName name, Digest digest, CallSettings callSettings = null) Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
digest |
DigestOptional. The digest of the data to sign. The digest must be produced with the same digest algorithm as specified by the key version's [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. This field may not be supplied if [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
Digest digest = new Digest();
// Make the request
AsymmetricSignResponse response = await keyManagementServiceClient.AsymmetricSignAsync(name, digest);
AsymmetricSignAsync(CryptoKeyVersionName, Digest, CancellationToken)
public virtual Task AsymmetricSignAsync(CryptoKeyVersionName name, Digest digest, CancellationToken cancellationToken) 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 |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
digest |
DigestOptional. The digest of the data to sign. The digest must be produced with the same digest algorithm as specified by the key version's [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. This field may not be supplied if [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
Digest digest = new Digest();
// Make the request
AsymmetricSignResponse response = await keyManagementServiceClient.AsymmetricSignAsync(name, digest);
AsymmetricSignAsync(string, Digest, CallSettings)
public virtual Task AsymmetricSignAsync(string name, Digest digest, CallSettings callSettings = null) Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
digest |
DigestOptional. The digest of the data to sign. The digest must be produced with the same digest algorithm as specified by the key version's [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. This field may not be supplied if [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
Digest digest = new Digest();
// Make the request
AsymmetricSignResponse response = await keyManagementServiceClient.AsymmetricSignAsync(name, digest);
AsymmetricSignAsync(string, Digest, CancellationToken)
public virtual Task AsymmetricSignAsync(string name, Digest digest, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
digest |
DigestOptional. The digest of the data to sign. The digest must be produced with the same digest algorithm as specified by the key version's [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. This field may not be supplied if [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data] is supplied. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskAsymmetricSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
Digest digest = new Digest();
// Make the request
AsymmetricSignResponse response = await keyManagementServiceClient.AsymmetricSignAsync(name, digest);
Create()
public static KeyManagementServiceClient Create()Synchronously creates a KeyManagementServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use KeyManagementServiceClientBuilder.
| Returns | |
|---|---|
| Type | Description |
KeyManagementServiceClient |
The created KeyManagementServiceClient. |
CreateAsync(CancellationToken)
public static Task CreateAsync(CancellationToken cancellationToken = default) Asynchronously creates a KeyManagementServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use KeyManagementServiceClientBuilder.
| Parameter | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenThe CancellationToken to use while creating the client. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyManagementServiceClient |
The task representing the created KeyManagementServiceClient. |
CreateCryptoKey(CreateCryptoKeyRequest, CallSettings)
public virtual CryptoKey CreateCryptoKey(CreateCryptoKeyRequest request, CallSettings callSettings = null)Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateCryptoKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CreateCryptoKeyRequest request = new CreateCryptoKeyRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
CryptoKeyId = "",
CryptoKey = new CryptoKey(),
SkipInitialVersionCreation = false,
TrustedWrappingEnabled = false,
};
// Make the request
CryptoKey response = keyManagementServiceClient.CreateCryptoKey(request);
CreateCryptoKey(KeyRingName, string, CryptoKey, CallSettings)
public virtual CryptoKey CreateCryptoKey(KeyRingName parent, string cryptoKeyId, CryptoKey cryptoKey, CallSettings callSettings = null)Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.
| Parameters | |
|---|---|
| Name | Description |
parent |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. |
cryptoKeyId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
cryptoKey |
CryptoKeyRequired. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
string cryptoKeyId = "";
CryptoKey cryptoKey = new CryptoKey();
// Make the request
CryptoKey response = keyManagementServiceClient.CreateCryptoKey(parent, cryptoKeyId, cryptoKey);
CreateCryptoKey(string, string, CryptoKey, CallSettings)
public virtual CryptoKey CreateCryptoKey(string parent, string cryptoKeyId, CryptoKey cryptoKey, CallSettings callSettings = null)Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. |
cryptoKeyId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
cryptoKey |
CryptoKeyRequired. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
string cryptoKeyId = "";
CryptoKey cryptoKey = new CryptoKey();
// Make the request
CryptoKey response = keyManagementServiceClient.CreateCryptoKey(parent, cryptoKeyId, cryptoKey);
CreateCryptoKeyAsync(CreateCryptoKeyRequest, CallSettings)
public virtual Task CreateCryptoKeyAsync(CreateCryptoKeyRequest request, CallSettings callSettings = null) Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateCryptoKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CreateCryptoKeyRequest request = new CreateCryptoKeyRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
CryptoKeyId = "",
CryptoKey = new CryptoKey(),
SkipInitialVersionCreation = false,
TrustedWrappingEnabled = false,
};
// Make the request
CryptoKey response = await keyManagementServiceClient.CreateCryptoKeyAsync(request);
CreateCryptoKeyAsync(CreateCryptoKeyRequest, CancellationToken)
public virtual Task CreateCryptoKeyAsync(CreateCryptoKeyRequest request, CancellationToken cancellationToken) 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 |
CreateCryptoKeyRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CreateCryptoKeyRequest request = new CreateCryptoKeyRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
CryptoKeyId = "",
CryptoKey = new CryptoKey(),
SkipInitialVersionCreation = false,
TrustedWrappingEnabled = false,
};
// Make the request
CryptoKey response = await keyManagementServiceClient.CreateCryptoKeyAsync(request);
CreateCryptoKeyAsync(KeyRingName, string, CryptoKey, CallSettings)
public virtual Task CreateCryptoKeyAsync(KeyRingName parent, string cryptoKeyId, CryptoKey cryptoKey, CallSettings callSettings = null) Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.
| Parameters | |
|---|---|
| Name | Description |
parent |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. |
cryptoKeyId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
cryptoKey |
CryptoKeyRequired. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
string cryptoKeyId = "";
CryptoKey cryptoKey = new CryptoKey();
// Make the request
CryptoKey response = await keyManagementServiceClient.CreateCryptoKeyAsync(parent, cryptoKeyId, cryptoKey);
CreateCryptoKeyAsync(KeyRingName, string, CryptoKey, CancellationToken)
public virtual Task CreateCryptoKeyAsync(KeyRingName parent, string cryptoKeyId, CryptoKey cryptoKey, CancellationToken cancellationToken) 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 |
parent |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. |
cryptoKeyId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
cryptoKey |
CryptoKeyRequired. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
string cryptoKeyId = "";
CryptoKey cryptoKey = new CryptoKey();
// Make the request
CryptoKey response = await keyManagementServiceClient.CreateCryptoKeyAsync(parent, cryptoKeyId, cryptoKey);
CreateCryptoKeyAsync(string, string, CryptoKey, CallSettings)
public virtual Task CreateCryptoKeyAsync(string parent, string cryptoKeyId, CryptoKey cryptoKey, CallSettings callSettings = null) Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] are required.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. |
cryptoKeyId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
cryptoKey |
CryptoKeyRequired. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
string cryptoKeyId = "";
CryptoKey cryptoKey = new CryptoKey();
// Make the request
CryptoKey response = await keyManagementServiceClient.CreateCryptoKeyAsync(parent, cryptoKeyId, cryptoKey);
CreateCryptoKeyAsync(string, string, CryptoKey, CancellationToken)
public virtual Task CreateCryptoKeyAsync(string parent, string cryptoKeyId, CryptoKey cryptoKey, CancellationToken cancellationToken) 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 |
parent |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey]. |
cryptoKeyId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
cryptoKey |
CryptoKeyRequired. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
string cryptoKeyId = "";
CryptoKey cryptoKey = new CryptoKey();
// Make the request
CryptoKey response = await keyManagementServiceClient.CreateCryptoKeyAsync(parent, cryptoKeyId, cryptoKey);
CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest, CallSettings)
public virtual CryptoKeyVersion CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest request, CallSettings callSettings = null)Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].
The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].
| Parameters | |
|---|---|
| Name | Description |
request |
CreateCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CreateCryptoKeyVersionRequest request = new CreateCryptoKeyVersionRequest
{
ParentAsCryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
CryptoKeyVersion = new CryptoKeyVersion(),
};
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.CreateCryptoKeyVersion(request);
CreateCryptoKeyVersion(CryptoKeyName, CryptoKeyVersion, CallSettings)
public virtual CryptoKeyVersion CreateCryptoKeyVersion(CryptoKeyName parent, CryptoKeyVersion cryptoKeyVersion, CallSettings callSettings = null)Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].
The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].
| Parameters | |
|---|---|
| Name | Description |
parent |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. |
cryptoKeyVersion |
CryptoKeyVersionRequired. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyName parent = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.CreateCryptoKeyVersion(parent, cryptoKeyVersion);
CreateCryptoKeyVersion(string, CryptoKeyVersion, CallSettings)
public virtual CryptoKeyVersion CreateCryptoKeyVersion(string parent, CryptoKeyVersion cryptoKeyVersion, CallSettings callSettings = null)Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].
The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. |
cryptoKeyVersion |
CryptoKeyVersionRequired. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.CreateCryptoKeyVersion(parent, cryptoKeyVersion);
CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest, CallSettings)
public virtual Task CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest request, CallSettings callSettings = null) Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].
The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].
| Parameters | |
|---|---|
| Name | Description |
request |
CreateCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CreateCryptoKeyVersionRequest request = new CreateCryptoKeyVersionRequest
{
ParentAsCryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
CryptoKeyVersion = new CryptoKeyVersion(),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.CreateCryptoKeyVersionAsync(request);
CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest, CancellationToken)
public virtual Task CreateCryptoKeyVersionAsync(CreateCryptoKeyVersionRequest request, CancellationToken cancellationToken) 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 |
CreateCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CreateCryptoKeyVersionRequest request = new CreateCryptoKeyVersionRequest
{
ParentAsCryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
CryptoKeyVersion = new CryptoKeyVersion(),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.CreateCryptoKeyVersionAsync(request);
CreateCryptoKeyVersionAsync(CryptoKeyName, CryptoKeyVersion, CallSettings)
public virtual Task CreateCryptoKeyVersionAsync(CryptoKeyName parent, CryptoKeyVersion cryptoKeyVersion, CallSettings callSettings = null) Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].
The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].
| Parameters | |
|---|---|
| Name | Description |
parent |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. |
cryptoKeyVersion |
CryptoKeyVersionRequired. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName parent = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.CreateCryptoKeyVersionAsync(parent, cryptoKeyVersion);
CreateCryptoKeyVersionAsync(CryptoKeyName, CryptoKeyVersion, CancellationToken)
public virtual Task CreateCryptoKeyVersionAsync(CryptoKeyName parent, CryptoKeyVersion cryptoKeyVersion, CancellationToken cancellationToken) 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 |
parent |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. |
cryptoKeyVersion |
CryptoKeyVersionRequired. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName parent = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.CreateCryptoKeyVersionAsync(parent, cryptoKeyVersion);
CreateCryptoKeyVersionAsync(string, CryptoKeyVersion, CallSettings)
public virtual Task CreateCryptoKeyVersionAsync(string parent, CryptoKeyVersion cryptoKeyVersion, CallSettings callSettings = null) Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].
The server will assign the next sequential id. If unset, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. |
cryptoKeyVersion |
CryptoKeyVersionRequired. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.CreateCryptoKeyVersionAsync(parent, cryptoKeyVersion);
CreateCryptoKeyVersionAsync(string, CryptoKeyVersion, CancellationToken)
public virtual Task CreateCryptoKeyVersionAsync(string parent, CryptoKeyVersion cryptoKeyVersion, CancellationToken cancellationToken) 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 |
parent |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. |
cryptoKeyVersion |
CryptoKeyVersionRequired. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.CreateCryptoKeyVersionAsync(parent, cryptoKeyVersion);
CreateImportJob(CreateImportJobRequest, CallSettings)
public virtual ImportJob CreateImportJob(CreateImportJobRequest request, CallSettings callSettings = null)Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateImportJobRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ImportJob |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CreateImportJobRequest request = new CreateImportJobRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
ImportJobId = "",
ImportJob = new ImportJob(),
};
// Make the request
ImportJob response = keyManagementServiceClient.CreateImportJob(request);
CreateImportJob(KeyRingName, string, ImportJob, CallSettings)
public virtual ImportJob CreateImportJob(KeyRingName parent, string importJobId, ImportJob importJob, CallSettings callSettings = null)Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
| Parameters | |
|---|---|
| Name | Description |
parent |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] associated with the [ImportJobs][google.cloud.kms.v1.ImportJob]. |
importJobId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
importJob |
ImportJobRequired. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ImportJob |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
string importJobId = "";
ImportJob importJob = new ImportJob();
// Make the request
ImportJob response = keyManagementServiceClient.CreateImportJob(parent, importJobId, importJob);
CreateImportJob(string, string, ImportJob, CallSettings)
public virtual ImportJob CreateImportJob(string parent, string importJobId, ImportJob importJob, CallSettings callSettings = null)Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] associated with the [ImportJobs][google.cloud.kms.v1.ImportJob]. |
importJobId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
importJob |
ImportJobRequired. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ImportJob |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
string importJobId = "";
ImportJob importJob = new ImportJob();
// Make the request
ImportJob response = keyManagementServiceClient.CreateImportJob(parent, importJobId, importJob);
CreateImportJobAsync(CreateImportJobRequest, CallSettings)
public virtual Task CreateImportJobAsync(CreateImportJobRequest request, CallSettings callSettings = null) Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateImportJobRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CreateImportJobRequest request = new CreateImportJobRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
ImportJobId = "",
ImportJob = new ImportJob(),
};
// Make the request
ImportJob response = await keyManagementServiceClient.CreateImportJobAsync(request);
CreateImportJobAsync(CreateImportJobRequest, CancellationToken)
public virtual Task CreateImportJobAsync(CreateImportJobRequest request, CancellationToken cancellationToken) 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 |
CreateImportJobRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CreateImportJobRequest request = new CreateImportJobRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
ImportJobId = "",
ImportJob = new ImportJob(),
};
// Make the request
ImportJob response = await keyManagementServiceClient.CreateImportJobAsync(request);
CreateImportJobAsync(KeyRingName, string, ImportJob, CallSettings)
public virtual Task CreateImportJobAsync(KeyRingName parent, string importJobId, ImportJob importJob, CallSettings callSettings = null) Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
| Parameters | |
|---|---|
| Name | Description |
parent |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] associated with the [ImportJobs][google.cloud.kms.v1.ImportJob]. |
importJobId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
importJob |
ImportJobRequired. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
string importJobId = "";
ImportJob importJob = new ImportJob();
// Make the request
ImportJob response = await keyManagementServiceClient.CreateImportJobAsync(parent, importJobId, importJob);
CreateImportJobAsync(KeyRingName, string, ImportJob, CancellationToken)
public virtual Task CreateImportJobAsync(KeyRingName parent, string importJobId, ImportJob importJob, CancellationToken cancellationToken) 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 |
parent |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] associated with the [ImportJobs][google.cloud.kms.v1.ImportJob]. |
importJobId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
importJob |
ImportJobRequired. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field values. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
string importJobId = "";
ImportJob importJob = new ImportJob();
// Make the request
ImportJob response = await keyManagementServiceClient.CreateImportJobAsync(parent, importJobId, importJob);
CreateImportJobAsync(string, string, ImportJob, CallSettings)
public virtual Task CreateImportJobAsync(string parent, string importJobId, ImportJob importJob, CallSettings callSettings = null) Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
[ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] associated with the [ImportJobs][google.cloud.kms.v1.ImportJob]. |
importJobId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
importJob |
ImportJobRequired. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
string importJobId = "";
ImportJob importJob = new ImportJob();
// Make the request
ImportJob response = await keyManagementServiceClient.CreateImportJobAsync(parent, importJobId, importJob);
CreateImportJobAsync(string, string, ImportJob, CancellationToken)
public virtual Task CreateImportJobAsync(string parent, string importJobId, ImportJob importJob, CancellationToken cancellationToken) 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 |
parent |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] associated with the [ImportJobs][google.cloud.kms.v1.ImportJob]. |
importJobId |
stringRequired. It must be unique within a KeyRing and match the regular
expression |
importJob |
ImportJobRequired. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field values. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
string importJobId = "";
ImportJob importJob = new ImportJob();
// Make the request
ImportJob response = await keyManagementServiceClient.CreateImportJobAsync(parent, importJobId, importJob);
CreateKeyRing(LocationName, string, KeyRing, CallSettings)
public virtual KeyRing CreateKeyRing(LocationName parent, string keyRingId, KeyRing keyRing, CallSettings callSettings = null)Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
keyRingId |
stringRequired. It must be unique within a location and match the regular
expression |
keyRing |
KeyRingRequired. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
KeyRing |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string keyRingId = "";
KeyRing keyRing = new KeyRing();
// Make the request
KeyRing response = keyManagementServiceClient.CreateKeyRing(parent, keyRingId, keyRing);
CreateKeyRing(CreateKeyRingRequest, CallSettings)
public virtual KeyRing CreateKeyRing(CreateKeyRingRequest request, CallSettings callSettings = null)Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateKeyRingRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
KeyRing |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CreateKeyRingRequest request = new CreateKeyRingRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
KeyRingId = "",
KeyRing = new KeyRing(),
};
// Make the request
KeyRing response = keyManagementServiceClient.CreateKeyRing(request);
CreateKeyRing(string, string, KeyRing, CallSettings)
public virtual KeyRing CreateKeyRing(string parent, string keyRingId, KeyRing keyRing, CallSettings callSettings = null)Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
keyRingId |
stringRequired. It must be unique within a location and match the regular
expression |
keyRing |
KeyRingRequired. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
KeyRing |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string keyRingId = "";
KeyRing keyRing = new KeyRing();
// Make the request
KeyRing response = keyManagementServiceClient.CreateKeyRing(parent, keyRingId, keyRing);
CreateKeyRingAsync(LocationName, string, KeyRing, CallSettings)
public virtual Task CreateKeyRingAsync(LocationName parent, string keyRingId, KeyRing keyRing, CallSettings callSettings = null) Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
keyRingId |
stringRequired. It must be unique within a location and match the regular
expression |
keyRing |
KeyRingRequired. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string keyRingId = "";
KeyRing keyRing = new KeyRing();
// Make the request
KeyRing response = await keyManagementServiceClient.CreateKeyRingAsync(parent, keyRingId, keyRing);
CreateKeyRingAsync(LocationName, string, KeyRing, CancellationToken)
public virtual Task CreateKeyRingAsync(LocationName parent, string keyRingId, KeyRing keyRing, CancellationToken cancellationToken) Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
keyRingId |
stringRequired. It must be unique within a location and match the regular
expression |
keyRing |
KeyRingRequired. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string keyRingId = "";
KeyRing keyRing = new KeyRing();
// Make the request
KeyRing response = await keyManagementServiceClient.CreateKeyRingAsync(parent, keyRingId, keyRing);
CreateKeyRingAsync(CreateKeyRingRequest, CallSettings)
public virtual Task CreateKeyRingAsync(CreateKeyRingRequest request, CallSettings callSettings = null) Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateKeyRingRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CreateKeyRingRequest request = new CreateKeyRingRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
KeyRingId = "",
KeyRing = new KeyRing(),
};
// Make the request
KeyRing response = await keyManagementServiceClient.CreateKeyRingAsync(request);
CreateKeyRingAsync(CreateKeyRingRequest, CancellationToken)
public virtual Task CreateKeyRingAsync(CreateKeyRingRequest request, CancellationToken cancellationToken) Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateKeyRingRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CreateKeyRingRequest request = new CreateKeyRingRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
KeyRingId = "",
KeyRing = new KeyRing(),
};
// Make the request
KeyRing response = await keyManagementServiceClient.CreateKeyRingAsync(request);
CreateKeyRingAsync(string, string, KeyRing, CallSettings)
public virtual Task CreateKeyRingAsync(string parent, string keyRingId, KeyRing keyRing, CallSettings callSettings = null) Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
keyRingId |
stringRequired. It must be unique within a location and match the regular
expression |
keyRing |
KeyRingRequired. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string keyRingId = "";
KeyRing keyRing = new KeyRing();
// Make the request
KeyRing response = await keyManagementServiceClient.CreateKeyRingAsync(parent, keyRingId, keyRing);
CreateKeyRingAsync(string, string, KeyRing, CancellationToken)
public virtual Task CreateKeyRingAsync(string parent, string keyRingId, KeyRing keyRing, CancellationToken cancellationToken) Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
keyRingId |
stringRequired. It must be unique within a location and match the regular
expression |
keyRing |
KeyRingRequired. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string keyRingId = "";
KeyRing keyRing = new KeyRing();
// Make the request
KeyRing response = await keyManagementServiceClient.CreateKeyRingAsync(parent, keyRingId, keyRing);
Decapsulate(DecapsulateRequest, CallSettings)
public virtual DecapsulateResponse Decapsulate(DecapsulateRequest request, CallSettings callSettings = null)Decapsulates data that was encapsulated 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] KEY_ENCAPSULATION.
| Parameters | |
|---|---|
| Name | Description |
request |
DecapsulateRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
DecapsulateResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
DecapsulateRequest request = new DecapsulateRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Ciphertext = ByteString.Empty,
CiphertextCrc32C = 0L,
};
// Make the request
DecapsulateResponse response = keyManagementServiceClient.Decapsulate(request);
DecapsulateAsync(DecapsulateRequest, CallSettings)
public virtual Task DecapsulateAsync(DecapsulateRequest request, CallSettings callSettings = null) Decapsulates data that was encapsulated 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] KEY_ENCAPSULATION.
| Parameters | |
|---|---|
| Name | Description |
request |
DecapsulateRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskDecapsulateResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DecapsulateRequest request = new DecapsulateRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Ciphertext = ByteString.Empty,
CiphertextCrc32C = 0L,
};
// Make the request
DecapsulateResponse response = await keyManagementServiceClient.DecapsulateAsync(request);
DecapsulateAsync(DecapsulateRequest, CancellationToken)
public virtual Task DecapsulateAsync(DecapsulateRequest request, CancellationToken cancellationToken) Decapsulates data that was encapsulated 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] KEY_ENCAPSULATION.
| Parameters | |
|---|---|
| Name | Description |
request |
DecapsulateRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskDecapsulateResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DecapsulateRequest request = new DecapsulateRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Ciphertext = ByteString.Empty,
CiphertextCrc32C = 0L,
};
// Make the request
DecapsulateResponse response = await keyManagementServiceClient.DecapsulateAsync(request);
Decrypt(CryptoKeyName, ByteString, CallSettings)
public virtual DecryptResponse Decrypt(CryptoKeyName name, ByteString ciphertext, CallSettings callSettings = null)Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The server will choose the appropriate version. |
ciphertext |
ByteStringRequired. The encrypted data originally returned in [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
DecryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
ByteString ciphertext = ByteString.Empty;
// Make the request
DecryptResponse response = keyManagementServiceClient.Decrypt(name, ciphertext);
Decrypt(DecryptRequest, CallSettings)
public virtual DecryptResponse Decrypt(DecryptRequest request, CallSettings callSettings = null)Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
DecryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
DecryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
DecryptRequest request = new DecryptRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
Ciphertext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
CiphertextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
};
// Make the request
DecryptResponse response = keyManagementServiceClient.Decrypt(request);
Decrypt(string, ByteString, CallSettings)
public virtual DecryptResponse Decrypt(string name, ByteString ciphertext, CallSettings callSettings = null)Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The server will choose the appropriate version. |
ciphertext |
ByteStringRequired. The encrypted data originally returned in [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
DecryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
ByteString ciphertext = ByteString.Empty;
// Make the request
DecryptResponse response = keyManagementServiceClient.Decrypt(name, ciphertext);
DecryptAsync(CryptoKeyName, ByteString, CallSettings)
public virtual Task DecryptAsync(CryptoKeyName name, ByteString ciphertext, CallSettings callSettings = null) Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The server will choose the appropriate version. |
ciphertext |
ByteStringRequired. The encrypted data originally returned in [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
ByteString ciphertext = ByteString.Empty;
// Make the request
DecryptResponse response = await keyManagementServiceClient.DecryptAsync(name, ciphertext);
DecryptAsync(CryptoKeyName, ByteString, CancellationToken)
public virtual Task DecryptAsync(CryptoKeyName name, ByteString ciphertext, CancellationToken cancellationToken) 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 |
name |
CryptoKeyNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The server will choose the appropriate version. |
ciphertext |
ByteStringRequired. The encrypted data originally returned in [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
ByteString ciphertext = ByteString.Empty;
// Make the request
DecryptResponse response = await keyManagementServiceClient.DecryptAsync(name, ciphertext);
DecryptAsync(DecryptRequest, CallSettings)
public virtual Task DecryptAsync(DecryptRequest request, CallSettings callSettings = null) Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
DecryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DecryptRequest request = new DecryptRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
Ciphertext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
CiphertextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
};
// Make the request
DecryptResponse response = await keyManagementServiceClient.DecryptAsync(request);
DecryptAsync(DecryptRequest, CancellationToken)
public virtual Task DecryptAsync(DecryptRequest request, CancellationToken cancellationToken) 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 |
DecryptRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DecryptRequest request = new DecryptRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
Ciphertext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
CiphertextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
};
// Make the request
DecryptResponse response = await keyManagementServiceClient.DecryptAsync(request);
DecryptAsync(string, ByteString, CallSettings)
public virtual Task DecryptAsync(string name, ByteString ciphertext, CallSettings callSettings = null) Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The server will choose the appropriate version. |
ciphertext |
ByteStringRequired. The encrypted data originally returned in [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
ByteString ciphertext = ByteString.Empty;
// Make the request
DecryptResponse response = await keyManagementServiceClient.DecryptAsync(name, ciphertext);
DecryptAsync(string, ByteString, CancellationToken)
public virtual Task DecryptAsync(string name, ByteString ciphertext, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The server will choose the appropriate version. |
ciphertext |
ByteStringRequired. The encrypted data originally returned in [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
ByteString ciphertext = ByteString.Empty;
// Make the request
DecryptResponse response = await keyManagementServiceClient.DecryptAsync(name, ciphertext);
DeleteCryptoKey(CryptoKeyName, CallSettings)
public virtual Operation DeleteCryptoKey(CryptoKeyName name, CallSettings callSettings = null) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to delete. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationEmptyDeleteCryptoKeyMetadata |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
// Make the request
Operation response = keyManagementServiceClient.DeleteCryptoKey(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = keyManagementServiceClient.PollOnceDeleteCryptoKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKey(DeleteCryptoKeyRequest, CallSettings)
public virtual Operation DeleteCryptoKey(DeleteCryptoKeyRequest request, CallSettings callSettings = null) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCryptoKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationEmptyDeleteCryptoKeyMetadata |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
DeleteCryptoKeyRequest request = new DeleteCryptoKeyRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
};
// Make the request
Operation response = keyManagementServiceClient.DeleteCryptoKey(request);
// Poll until the returned long-running operation is complete
Operation completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = keyManagementServiceClient.PollOnceDeleteCryptoKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKey(string, CallSettings)
public virtual Operation DeleteCryptoKey(string name, CallSettings callSettings = null) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to delete. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationEmptyDeleteCryptoKeyMetadata |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
// Make the request
Operation response = keyManagementServiceClient.DeleteCryptoKey(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = keyManagementServiceClient.PollOnceDeleteCryptoKey(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyAsync(CryptoKeyName, CallSettings)
public virtual Task> DeleteCryptoKeyAsync(CryptoKeyName name, CallSettings callSettings = null) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to delete. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyAsync(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyAsync(CryptoKeyName, CancellationToken)
public virtual Task> DeleteCryptoKeyAsync(CryptoKeyName name, CancellationToken cancellationToken) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to delete. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyAsync(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyAsync(DeleteCryptoKeyRequest, CallSettings)
public virtual Task> DeleteCryptoKeyAsync(DeleteCryptoKeyRequest request, CallSettings callSettings = null) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCryptoKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteCryptoKeyRequest request = new DeleteCryptoKeyRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
};
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyAsync(request);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyAsync(DeleteCryptoKeyRequest, CancellationToken)
public virtual Task> DeleteCryptoKeyAsync(DeleteCryptoKeyRequest request, CancellationToken cancellationToken) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCryptoKeyRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteCryptoKeyRequest request = new DeleteCryptoKeyRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
};
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyAsync(request);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyAsync(string, CallSettings)
public virtual Task> DeleteCryptoKeyAsync(string name, CallSettings callSettings = null) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to delete. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyAsync(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyAsync(string, CancellationToken)
public virtual Task> DeleteCryptoKeyAsync(string name, CancellationToken cancellationToken) Permanently deletes the given [CryptoKey][google.cloud.kms.v1.CryptoKey]. All child [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] must have been previously deleted using [KeyManagementService.DeleteCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DeleteCryptoKeyVersion]. The specified crypto key will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to delete. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyAsync(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersion(CryptoKeyVersionName, CallSettings)
public virtual Operation DeleteCryptoKeyVersion(CryptoKeyVersionName name, CallSettings callSettings = null) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to delete. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationEmptyDeleteCryptoKeyVersionMetadata |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
Operation response = keyManagementServiceClient.DeleteCryptoKeyVersion(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = keyManagementServiceClient.PollOnceDeleteCryptoKeyVersion(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersion(DeleteCryptoKeyVersionRequest, CallSettings)
public virtual Operation DeleteCryptoKeyVersion(DeleteCryptoKeyVersionRequest request, CallSettings callSettings = null) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationEmptyDeleteCryptoKeyVersionMetadata |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
DeleteCryptoKeyVersionRequest request = new DeleteCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
Operation response = keyManagementServiceClient.DeleteCryptoKeyVersion(request);
// Poll until the returned long-running operation is complete
Operation completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = keyManagementServiceClient.PollOnceDeleteCryptoKeyVersion(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersion(string, CallSettings)
public virtual Operation DeleteCryptoKeyVersion(string name, CallSettings callSettings = null) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to delete. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationEmptyDeleteCryptoKeyVersionMetadata |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
Operation response = keyManagementServiceClient.DeleteCryptoKeyVersion(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = keyManagementServiceClient.PollOnceDeleteCryptoKeyVersion(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersionAsync(CryptoKeyVersionName, CallSettings)
public virtual Task> DeleteCryptoKeyVersionAsync(CryptoKeyVersionName name, CallSettings callSettings = null) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to delete. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyVersionMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyVersionAsync(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyVersionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersionAsync(CryptoKeyVersionName, CancellationToken)
public virtual Task> DeleteCryptoKeyVersionAsync(CryptoKeyVersionName name, CancellationToken cancellationToken) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to delete. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyVersionMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyVersionAsync(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyVersionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersionAsync(DeleteCryptoKeyVersionRequest, CallSettings)
public virtual Task> DeleteCryptoKeyVersionAsync(DeleteCryptoKeyVersionRequest request, CallSettings callSettings = null) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyVersionMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteCryptoKeyVersionRequest request = new DeleteCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyVersionAsync(request);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyVersionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersionAsync(DeleteCryptoKeyVersionRequest, CancellationToken)
public virtual Task> DeleteCryptoKeyVersionAsync(DeleteCryptoKeyVersionRequest request, CancellationToken cancellationToken) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyVersionMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteCryptoKeyVersionRequest request = new DeleteCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyVersionAsync(request);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyVersionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersionAsync(string, CallSettings)
public virtual Task> DeleteCryptoKeyVersionAsync(string name, CallSettings callSettings = null) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to delete. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyVersionMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyVersionAsync(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyVersionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteCryptoKeyVersionAsync(string, CancellationToken)
public virtual Task> DeleteCryptoKeyVersionAsync(string name, CancellationToken cancellationToken) Permanently deletes the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Only possible if the version has not been previously imported and if its [state][google.cloud.kms.v1.CryptoKeyVersion.state] is one of [DESTROYED][CryptoKeyVersionState.DESTROYED], [IMPORT_FAILED][CryptoKeyVersionState.IMPORT_FAILED], or [GENERATION_FAILED][CryptoKeyVersionState.GENERATION_FAILED]. Successfully imported [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] cannot be deleted at this time. The specified version will be immediately and permanently deleted upon calling this method. This action cannot be undone.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to delete. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyVersionMetadata |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
Operation response = await keyManagementServiceClient.DeleteCryptoKeyVersionAsync(name);
// Poll until the returned long-running operation is complete
Operation completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation retrievedResponse = await keyManagementServiceClient.PollOnceDeleteCryptoKeyVersionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DestroyCryptoKeyVersion(CryptoKeyVersionName, CallSettings)
public virtual CryptoKeyVersion DestroyCryptoKeyVersion(CryptoKeyVersionName name, CallSettings callSettings = null)Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.
Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to the time [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] in the future. At that time, the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically change to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed.
Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.DestroyCryptoKeyVersion(name);
DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest, CallSettings)
public virtual CryptoKeyVersion DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request, CallSettings callSettings = null)Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.
Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to the time [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] in the future. At that time, the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically change to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed.
Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.
| Parameters | |
|---|---|
| Name | Description |
request |
DestroyCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
DestroyCryptoKeyVersionRequest request = new DestroyCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.DestroyCryptoKeyVersion(request);
DestroyCryptoKeyVersion(string, CallSettings)
public virtual CryptoKeyVersion DestroyCryptoKeyVersion(string name, CallSettings callSettings = null)Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.
Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to the time [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] in the future. At that time, the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically change to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed.
Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.DestroyCryptoKeyVersion(name);
DestroyCryptoKeyVersionAsync(CryptoKeyVersionName, CallSettings)
public virtual Task DestroyCryptoKeyVersionAsync(CryptoKeyVersionName name, CallSettings callSettings = null) Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.
Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to the time [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] in the future. At that time, the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically change to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed.
Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.DestroyCryptoKeyVersionAsync(name);
DestroyCryptoKeyVersionAsync(CryptoKeyVersionName, CancellationToken)
public virtual Task DestroyCryptoKeyVersionAsync(CryptoKeyVersionName name, CancellationToken cancellationToken) 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 |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.DestroyCryptoKeyVersionAsync(name);
DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest, CallSettings)
public virtual Task DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest request, CallSettings callSettings = null) Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.
Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to the time [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] in the future. At that time, the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically change to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed.
Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.
| Parameters | |
|---|---|
| Name | Description |
request |
DestroyCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DestroyCryptoKeyVersionRequest request = new DestroyCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.DestroyCryptoKeyVersionAsync(request);
DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest, CancellationToken)
public virtual Task DestroyCryptoKeyVersionAsync(DestroyCryptoKeyVersionRequest request, CancellationToken cancellationToken) 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 |
DestroyCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
DestroyCryptoKeyVersionRequest request = new DestroyCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.DestroyCryptoKeyVersionAsync(request);
DestroyCryptoKeyVersionAsync(string, CallSettings)
public virtual Task DestroyCryptoKeyVersionAsync(string name, CallSettings callSettings = null) Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.
Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to the time [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration] in the future. At that time, the [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically change to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key material will be irrevocably destroyed.
Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.DestroyCryptoKeyVersionAsync(name);
DestroyCryptoKeyVersionAsync(string, CancellationToken)
public virtual Task DestroyCryptoKeyVersionAsync(string name, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.DestroyCryptoKeyVersionAsync(name);
Encrypt(IResourceName, ByteString, CallSettings)
public virtual EncryptResponse Encrypt(IResourceName name, ByteString plaintext, CallSettings callSettings = null)Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
IResourceNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] or [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for encryption. If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. |
plaintext |
ByteStringRequired. The data to encrypt. Must be no larger than 64KiB. The maximum size depends on the key version's [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the plaintext must be no larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
EncryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
ByteString plaintext = ByteString.Empty;
// Make the request
EncryptResponse response = keyManagementServiceClient.Encrypt(name, plaintext);
Encrypt(EncryptRequest, CallSettings)
public virtual EncryptResponse Encrypt(EncryptRequest request, CallSettings callSettings = null)Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
EncryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
EncryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
EncryptRequest request = new EncryptRequest
{
ResourceName = new UnparsedResourceName("a/wildcard/resource"),
Plaintext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
PlaintextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
};
// Make the request
EncryptResponse response = keyManagementServiceClient.Encrypt(request);
Encrypt(string, ByteString, CallSettings)
public virtual EncryptResponse Encrypt(string name, ByteString plaintext, CallSettings callSettings = null)Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] or [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for encryption. If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. |
plaintext |
ByteStringRequired. The data to encrypt. Must be no larger than 64KiB. The maximum size depends on the key version's [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the plaintext must be no larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
EncryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "a/wildcard/resource";
ByteString plaintext = ByteString.Empty;
// Make the request
EncryptResponse response = keyManagementServiceClient.Encrypt(name, plaintext);
EncryptAsync(IResourceName, ByteString, CallSettings)
public virtual Task EncryptAsync(IResourceName name, ByteString plaintext, CallSettings callSettings = null) Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
IResourceNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] or [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for encryption. If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. |
plaintext |
ByteStringRequired. The data to encrypt. Must be no larger than 64KiB. The maximum size depends on the key version's [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the plaintext must be no larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskEncryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
ByteString plaintext = ByteString.Empty;
// Make the request
EncryptResponse response = await keyManagementServiceClient.EncryptAsync(name, plaintext);
EncryptAsync(IResourceName, ByteString, CancellationToken)
public virtual Task EncryptAsync(IResourceName name, ByteString plaintext, CancellationToken cancellationToken) 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 |
name |
IResourceNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] or [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for encryption. If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. |
plaintext |
ByteStringRequired. The data to encrypt. Must be no larger than 64KiB. The maximum size depends on the key version's [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the plaintext must be no larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskEncryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
ByteString plaintext = ByteString.Empty;
// Make the request
EncryptResponse response = await keyManagementServiceClient.EncryptAsync(name, plaintext);
EncryptAsync(EncryptRequest, CallSettings)
public virtual Task EncryptAsync(EncryptRequest request, CallSettings callSettings = null) Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
EncryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskEncryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
EncryptRequest request = new EncryptRequest
{
ResourceName = new UnparsedResourceName("a/wildcard/resource"),
Plaintext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
PlaintextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
};
// Make the request
EncryptResponse response = await keyManagementServiceClient.EncryptAsync(request);
EncryptAsync(EncryptRequest, CancellationToken)
public virtual Task EncryptAsync(EncryptRequest request, CancellationToken cancellationToken) 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 |
EncryptRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskEncryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
EncryptRequest request = new EncryptRequest
{
ResourceName = new UnparsedResourceName("a/wildcard/resource"),
Plaintext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
PlaintextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
};
// Make the request
EncryptResponse response = await keyManagementServiceClient.EncryptAsync(request);
EncryptAsync(string, ByteString, CallSettings)
public virtual Task EncryptAsync(string name, ByteString plaintext, CallSettings callSettings = null) Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] or [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for encryption. If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. |
plaintext |
ByteStringRequired. The data to encrypt. Must be no larger than 64KiB. The maximum size depends on the key version's [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the plaintext must be no larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskEncryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "a/wildcard/resource";
ByteString plaintext = ByteString.Empty;
// Make the request
EncryptResponse response = await keyManagementServiceClient.EncryptAsync(name, plaintext);
EncryptAsync(string, ByteString, CancellationToken)
public virtual Task EncryptAsync(string name, ByteString plaintext, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] or [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for encryption. If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its [primary version][google.cloud.kms.v1.CryptoKey.primary]. |
plaintext |
ByteStringRequired. The data to encrypt. Must be no larger than 64KiB. The maximum size depends on the key version's [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE], [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the plaintext must be no larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskEncryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "a/wildcard/resource";
ByteString plaintext = ByteString.Empty;
// Make the request
EncryptResponse response = await keyManagementServiceClient.EncryptAsync(name, plaintext);
ExportTrustedKeyWrappedCryptoKeyVersion(ExportTrustedKeyWrappedCryptoKeyVersionRequest, CallSettings)
public virtual ExportTrustedKeyWrappedCryptoKeyVersionResponse ExportTrustedKeyWrappedCryptoKeyVersion(ExportTrustedKeyWrappedCryptoKeyVersionRequest request, CallSettings callSettings = null)Exports a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with a trusted key.
The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must have trusted_wrapping_enabled set to true. The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] of the [wrapping_key] must have the [AES_WRAPPING][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.AES_WRAPPING] purpose. The [wrapping_key] must have the [AES_256_KWP][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.AES_256_KWP] algorithm.
| Parameters | |
|---|---|
| Name | Description |
request |
ExportTrustedKeyWrappedCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ExportTrustedKeyWrappedCryptoKeyVersionResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ExportTrustedKeyWrappedCryptoKeyVersionRequest request = new ExportTrustedKeyWrappedCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
WrappingKeyAsCryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
ExportTrustedKeyWrappedCryptoKeyVersionResponse response = keyManagementServiceClient.ExportTrustedKeyWrappedCryptoKeyVersion(request);
ExportTrustedKeyWrappedCryptoKeyVersionAsync(ExportTrustedKeyWrappedCryptoKeyVersionRequest, CallSettings)
public virtual Task ExportTrustedKeyWrappedCryptoKeyVersionAsync(ExportTrustedKeyWrappedCryptoKeyVersionRequest request, CallSettings callSettings = null) Exports a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with a trusted key.
The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must have trusted_wrapping_enabled set to true. The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] of the [wrapping_key] must have the [AES_WRAPPING][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.AES_WRAPPING] purpose. The [wrapping_key] must have the [AES_256_KWP][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.AES_256_KWP] algorithm.
| Parameters | |
|---|---|
| Name | Description |
request |
ExportTrustedKeyWrappedCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskExportTrustedKeyWrappedCryptoKeyVersionResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ExportTrustedKeyWrappedCryptoKeyVersionRequest request = new ExportTrustedKeyWrappedCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
WrappingKeyAsCryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
ExportTrustedKeyWrappedCryptoKeyVersionResponse response = await keyManagementServiceClient.ExportTrustedKeyWrappedCryptoKeyVersionAsync(request);
ExportTrustedKeyWrappedCryptoKeyVersionAsync(ExportTrustedKeyWrappedCryptoKeyVersionRequest, CancellationToken)
public virtual Task ExportTrustedKeyWrappedCryptoKeyVersionAsync(ExportTrustedKeyWrappedCryptoKeyVersionRequest request, CancellationToken cancellationToken) Exports a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with a trusted key.
The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must have trusted_wrapping_enabled set to true. The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] of the [wrapping_key] must have the [AES_WRAPPING][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.AES_WRAPPING] purpose. The [wrapping_key] must have the [AES_256_KWP][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.AES_256_KWP] algorithm.
| Parameters | |
|---|---|
| Name | Description |
request |
ExportTrustedKeyWrappedCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskExportTrustedKeyWrappedCryptoKeyVersionResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ExportTrustedKeyWrappedCryptoKeyVersionRequest request = new ExportTrustedKeyWrappedCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
WrappingKeyAsCryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
ExportTrustedKeyWrappedCryptoKeyVersionResponse response = await keyManagementServiceClient.ExportTrustedKeyWrappedCryptoKeyVersionAsync(request);
GenerateRandomBytes(GenerateRandomBytesRequest, CallSettings)
public virtual GenerateRandomBytesResponse GenerateRandomBytes(GenerateRandomBytesRequest request, CallSettings callSettings = null)Generate random bytes using the Cloud KMS randomness source in the provided location.
| Parameters | |
|---|---|
| Name | Description |
request |
GenerateRandomBytesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
GenerateRandomBytesResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
GenerateRandomBytesRequest request = new GenerateRandomBytesRequest
{
Location = "",
LengthBytes = 0,
ProtectionLevel = ProtectionLevel.Unspecified,
};
// Make the request
GenerateRandomBytesResponse response = keyManagementServiceClient.GenerateRandomBytes(request);
GenerateRandomBytes(string, int, ProtectionLevel, CallSettings)
public virtual GenerateRandomBytesResponse GenerateRandomBytes(string location, int lengthBytes, ProtectionLevel protectionLevel, CallSettings callSettings = null)Generate random bytes using the Cloud KMS randomness source in the provided location.
| Parameters | |
|---|---|
| Name | Description |
location |
stringThe project-specific location in which to generate random bytes. For example, "projects/my-project/locations/us-central1". |
lengthBytes |
intThe length in bytes of the amount of randomness to retrieve. Minimum 8 bytes, maximum 1024 bytes. |
protectionLevel |
ProtectionLevelThe [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when generating the random data. Currently, only [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is supported. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
GenerateRandomBytesResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string location = "";
int lengthBytes = 0;
ProtectionLevel protectionLevel = ProtectionLevel.Unspecified;
// Make the request
GenerateRandomBytesResponse response = keyManagementServiceClient.GenerateRandomBytes(location, lengthBytes, protectionLevel);
GenerateRandomBytesAsync(GenerateRandomBytesRequest, CallSettings)
public virtual Task GenerateRandomBytesAsync(GenerateRandomBytesRequest request, CallSettings callSettings = null) Generate random bytes using the Cloud KMS randomness source in the provided location.
| Parameters | |
|---|---|
| Name | Description |
request |
GenerateRandomBytesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskGenerateRandomBytesResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateRandomBytesRequest request = new GenerateRandomBytesRequest
{
Location = "",
LengthBytes = 0,
ProtectionLevel = ProtectionLevel.Unspecified,
};
// Make the request
GenerateRandomBytesResponse response = await keyManagementServiceClient.GenerateRandomBytesAsync(request);
GenerateRandomBytesAsync(GenerateRandomBytesRequest, CancellationToken)
public virtual Task GenerateRandomBytesAsync(GenerateRandomBytesRequest request, CancellationToken cancellationToken) Generate random bytes using the Cloud KMS randomness source in the provided location.
| Parameters | |
|---|---|
| Name | Description |
request |
GenerateRandomBytesRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskGenerateRandomBytesResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateRandomBytesRequest request = new GenerateRandomBytesRequest
{
Location = "",
LengthBytes = 0,
ProtectionLevel = ProtectionLevel.Unspecified,
};
// Make the request
GenerateRandomBytesResponse response = await keyManagementServiceClient.GenerateRandomBytesAsync(request);
GenerateRandomBytesAsync(string, int, ProtectionLevel, CallSettings)
public virtual Task GenerateRandomBytesAsync(string location, int lengthBytes, ProtectionLevel protectionLevel, CallSettings callSettings = null) Generate random bytes using the Cloud KMS randomness source in the provided location.
| Parameters | |
|---|---|
| Name | Description |
location |
stringThe project-specific location in which to generate random bytes. For example, "projects/my-project/locations/us-central1". |
lengthBytes |
intThe length in bytes of the amount of randomness to retrieve. Minimum 8 bytes, maximum 1024 bytes. |
protectionLevel |
ProtectionLevelThe [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when generating the random data. Currently, only [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is supported. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskGenerateRandomBytesResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string location = "";
int lengthBytes = 0;
ProtectionLevel protectionLevel = ProtectionLevel.Unspecified;
// Make the request
GenerateRandomBytesResponse response = await keyManagementServiceClient.GenerateRandomBytesAsync(location, lengthBytes, protectionLevel);
GenerateRandomBytesAsync(string, int, ProtectionLevel, CancellationToken)
public virtual Task GenerateRandomBytesAsync(string location, int lengthBytes, ProtectionLevel protectionLevel, CancellationToken cancellationToken) Generate random bytes using the Cloud KMS randomness source in the provided location.
| Parameters | |
|---|---|
| Name | Description |
location |
stringThe project-specific location in which to generate random bytes. For example, "projects/my-project/locations/us-central1". |
lengthBytes |
intThe length in bytes of the amount of randomness to retrieve. Minimum 8 bytes, maximum 1024 bytes. |
protectionLevel |
ProtectionLevelThe [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when generating the random data. Currently, only [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is supported. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskGenerateRandomBytesResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string location = "";
int lengthBytes = 0;
ProtectionLevel protectionLevel = ProtectionLevel.Unspecified;
// Make the request
GenerateRandomBytesResponse response = await keyManagementServiceClient.GenerateRandomBytesAsync(location, lengthBytes, protectionLevel);
GetCryptoKey(CryptoKeyName, CallSettings)
public virtual CryptoKey GetCryptoKey(CryptoKeyName name, CallSettings callSettings = null)Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
// Make the request
CryptoKey response = keyManagementServiceClient.GetCryptoKey(name);
GetCryptoKey(GetCryptoKeyRequest, CallSettings)
public virtual CryptoKey GetCryptoKey(GetCryptoKeyRequest request, CallSettings callSettings = null)Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
request |
GetCryptoKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
GetCryptoKeyRequest request = new GetCryptoKeyRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
};
// Make the request
CryptoKey response = keyManagementServiceClient.GetCryptoKey(request);
GetCryptoKey(string, CallSettings)
public virtual CryptoKey GetCryptoKey(string name, CallSettings callSettings = null)Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
// Make the request
CryptoKey response = keyManagementServiceClient.GetCryptoKey(name);
GetCryptoKeyAsync(CryptoKeyName, CallSettings)
public virtual Task GetCryptoKeyAsync(CryptoKeyName name, CallSettings callSettings = null) Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
// Make the request
CryptoKey response = await keyManagementServiceClient.GetCryptoKeyAsync(name);
GetCryptoKeyAsync(CryptoKeyName, CancellationToken)
public virtual Task GetCryptoKeyAsync(CryptoKeyName name, CancellationToken cancellationToken) 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 |
name |
CryptoKeyNameRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
// Make the request
CryptoKey response = await keyManagementServiceClient.GetCryptoKeyAsync(name);
GetCryptoKeyAsync(GetCryptoKeyRequest, CallSettings)
public virtual Task GetCryptoKeyAsync(GetCryptoKeyRequest request, CallSettings callSettings = null) Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
request |
GetCryptoKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetCryptoKeyRequest request = new GetCryptoKeyRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
};
// Make the request
CryptoKey response = await keyManagementServiceClient.GetCryptoKeyAsync(request);
GetCryptoKeyAsync(GetCryptoKeyRequest, CancellationToken)
public virtual Task GetCryptoKeyAsync(GetCryptoKeyRequest request, CancellationToken cancellationToken) 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 |
GetCryptoKeyRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetCryptoKeyRequest request = new GetCryptoKeyRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
};
// Make the request
CryptoKey response = await keyManagementServiceClient.GetCryptoKeyAsync(request);
GetCryptoKeyAsync(string, CallSettings)
public virtual Task GetCryptoKeyAsync(string name, CallSettings callSettings = null) Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
// Make the request
CryptoKey response = await keyManagementServiceClient.GetCryptoKeyAsync(name);
GetCryptoKeyAsync(string, CancellationToken)
public virtual Task GetCryptoKeyAsync(string name, CancellationToken cancellationToken) 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 |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
// Make the request
CryptoKey response = await keyManagementServiceClient.GetCryptoKeyAsync(name);
GetCryptoKeyVersion(CryptoKeyVersionName, CallSettings)
public virtual CryptoKeyVersion GetCryptoKeyVersion(CryptoKeyVersionName name, CallSettings callSettings = null)Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.GetCryptoKeyVersion(name);
GetCryptoKeyVersion(GetCryptoKeyVersionRequest, CallSettings)
public virtual CryptoKeyVersion GetCryptoKeyVersion(GetCryptoKeyVersionRequest request, CallSettings callSettings = null)Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
request |
GetCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
GetCryptoKeyVersionRequest request = new GetCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.GetCryptoKeyVersion(request);
GetCryptoKeyVersion(string, CallSettings)
public virtual CryptoKeyVersion GetCryptoKeyVersion(string name, CallSettings callSettings = null)Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.GetCryptoKeyVersion(name);
GetCryptoKeyVersionAsync(CryptoKeyVersionName, CallSettings)
public virtual Task GetCryptoKeyVersionAsync(CryptoKeyVersionName name, CallSettings callSettings = null) Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.GetCryptoKeyVersionAsync(name);
GetCryptoKeyVersionAsync(CryptoKeyVersionName, CancellationToken)
public virtual Task GetCryptoKeyVersionAsync(CryptoKeyVersionName name, CancellationToken cancellationToken) Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.GetCryptoKeyVersionAsync(name);
GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest, CallSettings)
public virtual Task GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest request, CallSettings callSettings = null) Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
request |
GetCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetCryptoKeyVersionRequest request = new GetCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.GetCryptoKeyVersionAsync(request);
GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest, CancellationToken)
public virtual Task GetCryptoKeyVersionAsync(GetCryptoKeyVersionRequest request, CancellationToken cancellationToken) Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
request |
GetCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetCryptoKeyVersionRequest request = new GetCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.GetCryptoKeyVersionAsync(request);
GetCryptoKeyVersionAsync(string, CallSettings)
public virtual Task GetCryptoKeyVersionAsync(string name, CallSettings callSettings = null) Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.GetCryptoKeyVersionAsync(name);
GetCryptoKeyVersionAsync(string, CancellationToken)
public virtual Task GetCryptoKeyVersionAsync(string name, CancellationToken cancellationToken) Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.GetCryptoKeyVersionAsync(name);
GetImportJob(GetImportJobRequest, CallSettings)
public virtual ImportJob GetImportJob(GetImportJobRequest request, CallSettings callSettings = null)Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
request |
GetImportJobRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ImportJob |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
GetImportJobRequest request = new GetImportJobRequest
{
ImportJobName = ImportJobName.FromProjectLocationKeyRingImportJob("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]"),
PublicKeyFormat = PublicKey.Types.PublicKeyFormat.Unspecified,
};
// Make the request
ImportJob response = keyManagementServiceClient.GetImportJob(request);
GetImportJob(ImportJobName, CallSettings)
public virtual ImportJob GetImportJob(ImportJobName name, CallSettings callSettings = null)Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
name |
ImportJobNameRequired. The [name][google.cloud.kms.v1.ImportJob.name] of the [ImportJob][google.cloud.kms.v1.ImportJob] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ImportJob |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ImportJobName name = ImportJobName.FromProjectLocationKeyRingImportJob("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]");
// Make the request
ImportJob response = keyManagementServiceClient.GetImportJob(name);
GetImportJob(string, CallSettings)
public virtual ImportJob GetImportJob(string name, CallSettings callSettings = null)Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.ImportJob.name] of the [ImportJob][google.cloud.kms.v1.ImportJob] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
ImportJob |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/importJobs/[IMPORT_JOB]";
// Make the request
ImportJob response = keyManagementServiceClient.GetImportJob(name);
GetImportJobAsync(GetImportJobRequest, CallSettings)
public virtual Task GetImportJobAsync(GetImportJobRequest request, CallSettings callSettings = null) Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
request |
GetImportJobRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetImportJobRequest request = new GetImportJobRequest
{
ImportJobName = ImportJobName.FromProjectLocationKeyRingImportJob("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]"),
PublicKeyFormat = PublicKey.Types.PublicKeyFormat.Unspecified,
};
// Make the request
ImportJob response = await keyManagementServiceClient.GetImportJobAsync(request);
GetImportJobAsync(GetImportJobRequest, CancellationToken)
public virtual Task GetImportJobAsync(GetImportJobRequest request, CancellationToken cancellationToken) Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
request |
GetImportJobRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetImportJobRequest request = new GetImportJobRequest
{
ImportJobName = ImportJobName.FromProjectLocationKeyRingImportJob("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]"),
PublicKeyFormat = PublicKey.Types.PublicKeyFormat.Unspecified,
};
// Make the request
ImportJob response = await keyManagementServiceClient.GetImportJobAsync(request);
GetImportJobAsync(ImportJobName, CallSettings)
public virtual Task GetImportJobAsync(ImportJobName name, CallSettings callSettings = null) Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
name |
ImportJobNameRequired. The [name][google.cloud.kms.v1.ImportJob.name] of the [ImportJob][google.cloud.kms.v1.ImportJob] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ImportJobName name = ImportJobName.FromProjectLocationKeyRingImportJob("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]");
// Make the request
ImportJob response = await keyManagementServiceClient.GetImportJobAsync(name);
GetImportJobAsync(ImportJobName, CancellationToken)
public virtual Task GetImportJobAsync(ImportJobName name, CancellationToken cancellationToken) Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
name |
ImportJobNameRequired. The [name][google.cloud.kms.v1.ImportJob.name] of the [ImportJob][google.cloud.kms.v1.ImportJob] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ImportJobName name = ImportJobName.FromProjectLocationKeyRingImportJob("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]");
// Make the request
ImportJob response = await keyManagementServiceClient.GetImportJobAsync(name);
GetImportJobAsync(string, CallSettings)
public virtual Task GetImportJobAsync(string name, CallSettings callSettings = null) Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.ImportJob.name] of the [ImportJob][google.cloud.kms.v1.ImportJob] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/importJobs/[IMPORT_JOB]";
// Make the request
ImportJob response = await keyManagementServiceClient.GetImportJobAsync(name);
GetImportJobAsync(string, CancellationToken)
public virtual Task GetImportJobAsync(string name, CancellationToken cancellationToken) Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.ImportJob.name] of the [ImportJob][google.cloud.kms.v1.ImportJob] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskImportJob |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/importJobs/[IMPORT_JOB]";
// Make the request
ImportJob response = await keyManagementServiceClient.GetImportJobAsync(name);
GetKeyRing(GetKeyRingRequest, CallSettings)
public virtual KeyRing GetKeyRing(GetKeyRingRequest request, CallSettings callSettings = null)Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
request |
GetKeyRingRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
KeyRing |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
GetKeyRingRequest request = new GetKeyRingRequest
{
KeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
};
// Make the request
KeyRing response = keyManagementServiceClient.GetKeyRing(request);
GetKeyRing(KeyRingName, CallSettings)
public virtual KeyRing GetKeyRing(KeyRingName name, CallSettings callSettings = null)Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
name |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
KeyRing |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
KeyRingName name = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
// Make the request
KeyRing response = keyManagementServiceClient.GetKeyRing(name);
GetKeyRing(string, CallSettings)
public virtual KeyRing GetKeyRing(string name, CallSettings callSettings = null)Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
KeyRing |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
// Make the request
KeyRing response = keyManagementServiceClient.GetKeyRing(name);
GetKeyRingAsync(GetKeyRingRequest, CallSettings)
public virtual Task GetKeyRingAsync(GetKeyRingRequest request, CallSettings callSettings = null) Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
request |
GetKeyRingRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetKeyRingRequest request = new GetKeyRingRequest
{
KeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
};
// Make the request
KeyRing response = await keyManagementServiceClient.GetKeyRingAsync(request);
GetKeyRingAsync(GetKeyRingRequest, CancellationToken)
public virtual Task GetKeyRingAsync(GetKeyRingRequest request, CancellationToken cancellationToken) Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
request |
GetKeyRingRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetKeyRingRequest request = new GetKeyRingRequest
{
KeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
};
// Make the request
KeyRing response = await keyManagementServiceClient.GetKeyRingAsync(request);
GetKeyRingAsync(KeyRingName, CallSettings)
public virtual Task GetKeyRingAsync(KeyRingName name, CallSettings callSettings = null) Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
name |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
KeyRingName name = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
// Make the request
KeyRing response = await keyManagementServiceClient.GetKeyRingAsync(name);
GetKeyRingAsync(KeyRingName, CancellationToken)
public virtual Task GetKeyRingAsync(KeyRingName name, CancellationToken cancellationToken) Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
name |
KeyRingNameRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
KeyRingName name = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
// Make the request
KeyRing response = await keyManagementServiceClient.GetKeyRingAsync(name);
GetKeyRingAsync(string, CallSettings)
public virtual Task GetKeyRingAsync(string name, CallSettings callSettings = null) Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
// Make the request
KeyRing response = await keyManagementServiceClient.GetKeyRingAsync(name);
GetKeyRingAsync(string, CancellationToken)
public virtual Task GetKeyRingAsync(string name, CancellationToken cancellationToken) Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.KeyRing.name] of the [KeyRing][google.cloud.kms.v1.KeyRing] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskKeyRing |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
// Make the request
KeyRing response = await keyManagementServiceClient.GetKeyRingAsync(name);
GetPublicKey(CryptoKeyVersionName, CallSettings)
public virtual PublicKey GetPublicKey(CryptoKeyVersionName name, CallSettings callSettings = null)Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PublicKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
PublicKey response = keyManagementServiceClient.GetPublicKey(name);
GetPublicKey(GetPublicKeyRequest, CallSettings)
public virtual PublicKey GetPublicKey(GetPublicKeyRequest request, CallSettings callSettings = null)Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
GetPublicKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PublicKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
GetPublicKeyRequest request = new GetPublicKeyRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
PublicKeyFormat = PublicKey.Types.PublicKeyFormat.Unspecified,
};
// Make the request
PublicKey response = keyManagementServiceClient.GetPublicKey(request);
GetPublicKey(string, CallSettings)
public virtual PublicKey GetPublicKey(string name, CallSettings callSettings = null)Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PublicKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
PublicKey response = keyManagementServiceClient.GetPublicKey(name);
GetPublicKeyAsync(CryptoKeyVersionName, CallSettings)
public virtual Task GetPublicKeyAsync(CryptoKeyVersionName name, CallSettings callSettings = null) Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskPublicKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
PublicKey response = await keyManagementServiceClient.GetPublicKeyAsync(name);
GetPublicKeyAsync(CryptoKeyVersionName, CancellationToken)
public virtual Task GetPublicKeyAsync(CryptoKeyVersionName name, CancellationToken cancellationToken) 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 |
name |
CryptoKeyVersionNameRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskPublicKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
PublicKey response = await keyManagementServiceClient.GetPublicKeyAsync(name);
GetPublicKeyAsync(GetPublicKeyRequest, CallSettings)
public virtual Task GetPublicKeyAsync(GetPublicKeyRequest request, CallSettings callSettings = null) Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
GetPublicKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskPublicKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetPublicKeyRequest request = new GetPublicKeyRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
PublicKeyFormat = PublicKey.Types.PublicKeyFormat.Unspecified,
};
// Make the request
PublicKey response = await keyManagementServiceClient.GetPublicKeyAsync(request);
GetPublicKeyAsync(GetPublicKeyRequest, CancellationToken)
public virtual Task GetPublicKeyAsync(GetPublicKeyRequest request, CancellationToken cancellationToken) 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 |
GetPublicKeyRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskPublicKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetPublicKeyRequest request = new GetPublicKeyRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
PublicKeyFormat = PublicKey.Types.PublicKeyFormat.Unspecified,
};
// Make the request
PublicKey response = await keyManagementServiceClient.GetPublicKeyAsync(request);
GetPublicKeyAsync(string, CallSettings)
public virtual Task GetPublicKeyAsync(string name, CallSettings callSettings = null) Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskPublicKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
PublicKey response = await keyManagementServiceClient.GetPublicKeyAsync(name);
GetPublicKeyAsync(string, CancellationToken)
public virtual Task GetPublicKeyAsync(string name, CancellationToken cancellationToken) 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 |
name |
stringRequired. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskPublicKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
PublicKey response = await keyManagementServiceClient.GetPublicKeyAsync(name);
GetRetiredResource(GetRetiredResourceRequest, CallSettings)
public virtual RetiredResource GetRetiredResource(GetRetiredResourceRequest request, CallSettings callSettings = null)Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
GetRetiredResourceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
RetiredResource |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
GetRetiredResourceRequest request = new GetRetiredResourceRequest
{
RetiredResourceName = RetiredResourceName.FromProjectLocationRetiredResource("[PROJECT]", "[LOCATION]", "[RETIRED_RESOURCE]"),
};
// Make the request
RetiredResource response = keyManagementServiceClient.GetRetiredResource(request);
GetRetiredResource(RetiredResourceName, CallSettings)
public virtual RetiredResource GetRetiredResource(RetiredResourceName name, CallSettings callSettings = null)Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
name |
RetiredResourceNameRequired. The [name][google.cloud.kms.v1.RetiredResource.name] of the [RetiredResource][google.cloud.kms.v1.RetiredResource] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
RetiredResource |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
RetiredResourceName name = RetiredResourceName.FromProjectLocationRetiredResource("[PROJECT]", "[LOCATION]", "[RETIRED_RESOURCE]");
// Make the request
RetiredResource response = keyManagementServiceClient.GetRetiredResource(name);
GetRetiredResource(string, CallSettings)
public virtual RetiredResource GetRetiredResource(string name, CallSettings callSettings = null)Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.RetiredResource.name] of the [RetiredResource][google.cloud.kms.v1.RetiredResource] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
RetiredResource |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/retiredResources/[RETIRED_RESOURCE]";
// Make the request
RetiredResource response = keyManagementServiceClient.GetRetiredResource(name);
GetRetiredResourceAsync(GetRetiredResourceRequest, CallSettings)
public virtual Task GetRetiredResourceAsync(GetRetiredResourceRequest request, CallSettings callSettings = null) Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
GetRetiredResourceRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRetiredResource |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetRetiredResourceRequest request = new GetRetiredResourceRequest
{
RetiredResourceName = RetiredResourceName.FromProjectLocationRetiredResource("[PROJECT]", "[LOCATION]", "[RETIRED_RESOURCE]"),
};
// Make the request
RetiredResource response = await keyManagementServiceClient.GetRetiredResourceAsync(request);
GetRetiredResourceAsync(GetRetiredResourceRequest, CancellationToken)
public virtual Task GetRetiredResourceAsync(GetRetiredResourceRequest request, CancellationToken cancellationToken) Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
GetRetiredResourceRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskRetiredResource |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
GetRetiredResourceRequest request = new GetRetiredResourceRequest
{
RetiredResourceName = RetiredResourceName.FromProjectLocationRetiredResource("[PROJECT]", "[LOCATION]", "[RETIRED_RESOURCE]"),
};
// Make the request
RetiredResource response = await keyManagementServiceClient.GetRetiredResourceAsync(request);
GetRetiredResourceAsync(RetiredResourceName, CallSettings)
public virtual Task GetRetiredResourceAsync(RetiredResourceName name, CallSettings callSettings = null) Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
name |
RetiredResourceNameRequired. The [name][google.cloud.kms.v1.RetiredResource.name] of the [RetiredResource][google.cloud.kms.v1.RetiredResource] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRetiredResource |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RetiredResourceName name = RetiredResourceName.FromProjectLocationRetiredResource("[PROJECT]", "[LOCATION]", "[RETIRED_RESOURCE]");
// Make the request
RetiredResource response = await keyManagementServiceClient.GetRetiredResourceAsync(name);
GetRetiredResourceAsync(RetiredResourceName, CancellationToken)
public virtual Task GetRetiredResourceAsync(RetiredResourceName name, CancellationToken cancellationToken) Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
name |
RetiredResourceNameRequired. The [name][google.cloud.kms.v1.RetiredResource.name] of the [RetiredResource][google.cloud.kms.v1.RetiredResource] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskRetiredResource |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RetiredResourceName name = RetiredResourceName.FromProjectLocationRetiredResource("[PROJECT]", "[LOCATION]", "[RETIRED_RESOURCE]");
// Make the request
RetiredResource response = await keyManagementServiceClient.GetRetiredResourceAsync(name);
GetRetiredResourceAsync(string, CallSettings)
public virtual Task GetRetiredResourceAsync(string name, CallSettings callSettings = null) Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.RetiredResource.name] of the [RetiredResource][google.cloud.kms.v1.RetiredResource] to get. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRetiredResource |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/retiredResources/[RETIRED_RESOURCE]";
// Make the request
RetiredResource response = await keyManagementServiceClient.GetRetiredResourceAsync(name);
GetRetiredResourceAsync(string, CancellationToken)
public virtual Task GetRetiredResourceAsync(string name, CancellationToken cancellationToken) Retrieves a specific [RetiredResource][google.cloud.kms.v1.RetiredResource] resource, which represents the record of a deleted [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The [name][google.cloud.kms.v1.RetiredResource.name] of the [RetiredResource][google.cloud.kms.v1.RetiredResource] to get. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskRetiredResource |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/retiredResources/[RETIRED_RESOURCE]";
// Make the request
RetiredResource response = await keyManagementServiceClient.GetRetiredResourceAsync(name);
ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest, CallSettings)
public virtual CryptoKeyVersion ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest request, CallSettings callSettings = null)Import wrapped key material into a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
ImportCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ImportCryptoKeyVersionRequest request = new ImportCryptoKeyVersionRequest
{
ParentAsCryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
Algorithm = CryptoKeyVersion.Types.CryptoKeyVersionAlgorithm.Unspecified,
ImportJob = "",
RsaAesWrappedKey = ByteString.Empty,
CryptoKeyVersionAsCryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
WrappedKey = ByteString.Empty,
TrustedWrappingEnabled = false,
};
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.ImportCryptoKeyVersion(request);
ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest, CallSettings)
public virtual Task ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest request, CallSettings callSettings = null) Import wrapped key material into a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
ImportCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ImportCryptoKeyVersionRequest request = new ImportCryptoKeyVersionRequest
{
ParentAsCryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
Algorithm = CryptoKeyVersion.Types.CryptoKeyVersionAlgorithm.Unspecified,
ImportJob = "",
RsaAesWrappedKey = ByteString.Empty,
CryptoKeyVersionAsCryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
WrappedKey = ByteString.Empty,
TrustedWrappingEnabled = false,
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.ImportCryptoKeyVersionAsync(request);
ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest, CancellationToken)
public virtual Task ImportCryptoKeyVersionAsync(ImportCryptoKeyVersionRequest request, CancellationToken cancellationToken) 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 |
ImportCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ImportCryptoKeyVersionRequest request = new ImportCryptoKeyVersionRequest
{
ParentAsCryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
Algorithm = CryptoKeyVersion.Types.CryptoKeyVersionAlgorithm.Unspecified,
ImportJob = "",
RsaAesWrappedKey = ByteString.Empty,
CryptoKeyVersionAsCryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
WrappedKey = ByteString.Empty,
TrustedWrappingEnabled = false,
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.ImportCryptoKeyVersionAsync(request);
ImportTrustedKeyWrappedCryptoKeyVersion(ImportTrustedKeyWrappedCryptoKeyVersionRequest, CallSettings)
public virtual CryptoKeyVersion ImportTrustedKeyWrappedCryptoKeyVersion(ImportTrustedKeyWrappedCryptoKeyVersionRequest request, CallSettings callSettings = null)Import wrapped key material into a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with a trusted key.
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].
The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] will have trusted_wrapping_enabled set to true.
| Parameters | |
|---|---|
| Name | Description |
request |
ImportTrustedKeyWrappedCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ImportTrustedKeyWrappedCryptoKeyVersionRequest request = new ImportTrustedKeyWrappedCryptoKeyVersionRequest
{
Parent = "",
ImportingKey = "",
CryptoKeyVersion = "",
WrappedKey = ByteString.Empty,
Algorithm = CryptoKeyVersion.Types.CryptoKeyVersionAlgorithm.Unspecified,
};
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.ImportTrustedKeyWrappedCryptoKeyVersion(request);
ImportTrustedKeyWrappedCryptoKeyVersionAsync(ImportTrustedKeyWrappedCryptoKeyVersionRequest, CallSettings)
public virtual Task ImportTrustedKeyWrappedCryptoKeyVersionAsync(ImportTrustedKeyWrappedCryptoKeyVersionRequest request, CallSettings callSettings = null) Import wrapped key material into a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with a trusted key.
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].
The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] will have trusted_wrapping_enabled set to true.
| Parameters | |
|---|---|
| Name | Description |
request |
ImportTrustedKeyWrappedCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ImportTrustedKeyWrappedCryptoKeyVersionRequest request = new ImportTrustedKeyWrappedCryptoKeyVersionRequest
{
Parent = "",
ImportingKey = "",
CryptoKeyVersion = "",
WrappedKey = ByteString.Empty,
Algorithm = CryptoKeyVersion.Types.CryptoKeyVersionAlgorithm.Unspecified,
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.ImportTrustedKeyWrappedCryptoKeyVersionAsync(request);
ImportTrustedKeyWrappedCryptoKeyVersionAsync(ImportTrustedKeyWrappedCryptoKeyVersionRequest, CancellationToken)
public virtual Task ImportTrustedKeyWrappedCryptoKeyVersionAsync(ImportTrustedKeyWrappedCryptoKeyVersionRequest request, CancellationToken cancellationToken) Import wrapped key material into a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with a trusted key.
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].
The [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] will have trusted_wrapping_enabled set to true.
| Parameters | |
|---|---|
| Name | Description |
request |
ImportTrustedKeyWrappedCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ImportTrustedKeyWrappedCryptoKeyVersionRequest request = new ImportTrustedKeyWrappedCryptoKeyVersionRequest
{
Parent = "",
ImportingKey = "",
CryptoKeyVersion = "",
WrappedKey = ByteString.Empty,
Algorithm = CryptoKeyVersion.Types.CryptoKeyVersionAlgorithm.Unspecified,
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.ImportTrustedKeyWrappedCryptoKeyVersionAsync(request);
ListCryptoKeyVersions(CryptoKeyName, string, int?, CallSettings)
public virtual PagedEnumerable ListCryptoKeyVersions(CryptoKeyName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
parent |
CryptoKeyNameRequired. The resource name of the
[CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion |
A pageable sequence of CryptoKeyVersion resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyName parent = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListCryptoKeyVersions(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (CryptoKeyVersion item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListCryptoKeyVersionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKeyVersion item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKeyVersion item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeyVersions(ListCryptoKeyVersionsRequest, CallSettings)
public virtual PagedEnumerable ListCryptoKeyVersions(ListCryptoKeyVersionsRequest request, CallSettings callSettings = null) Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
request |
ListCryptoKeyVersionsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion |
A pageable sequence of CryptoKeyVersion resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ListCryptoKeyVersionsRequest request = new ListCryptoKeyVersionsRequest
{
ParentAsCryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
View = CryptoKeyVersion.Types.CryptoKeyVersionView.Unspecified,
Filter = "",
OrderBy = "",
};
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListCryptoKeyVersions(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (CryptoKeyVersion item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListCryptoKeyVersionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKeyVersion item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKeyVersion item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeyVersions(string, string, int?, CallSettings)
public virtual PagedEnumerable ListCryptoKeyVersions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the
[CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion |
A pageable sequence of CryptoKeyVersion resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListCryptoKeyVersions(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (CryptoKeyVersion item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListCryptoKeyVersionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKeyVersion item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKeyVersion item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeyVersionsAsync(CryptoKeyName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListCryptoKeyVersionsAsync(CryptoKeyName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
parent |
CryptoKeyNameRequired. The resource name of the
[CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion |
A pageable asynchronous sequence of CryptoKeyVersion resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName parent = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListCryptoKeyVersionsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CryptoKeyVersion item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListCryptoKeyVersionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKeyVersion item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKeyVersion item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeyVersionsAsync(ListCryptoKeyVersionsRequest, CallSettings)
public virtual PagedAsyncEnumerable ListCryptoKeyVersionsAsync(ListCryptoKeyVersionsRequest request, CallSettings callSettings = null) Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
request |
ListCryptoKeyVersionsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion |
A pageable asynchronous sequence of CryptoKeyVersion resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ListCryptoKeyVersionsRequest request = new ListCryptoKeyVersionsRequest
{
ParentAsCryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
View = CryptoKeyVersion.Types.CryptoKeyVersionView.Unspecified,
Filter = "",
OrderBy = "",
};
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListCryptoKeyVersionsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CryptoKeyVersion item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListCryptoKeyVersionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKeyVersion item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKeyVersion item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeyVersionsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListCryptoKeyVersionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the
[CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCryptoKeyVersionsResponseCryptoKeyVersion |
A pageable asynchronous sequence of CryptoKeyVersion resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListCryptoKeyVersionsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CryptoKeyVersion item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListCryptoKeyVersionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKeyVersion item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKeyVersion item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeys(KeyRingName, string, int?, CallSettings)
public virtual PagedEnumerable ListCryptoKeys(KeyRingName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
parent |
KeyRingNameRequired. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
to list, in the format |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCryptoKeysResponseCryptoKey |
A pageable sequence of CryptoKey resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListCryptoKeys(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (CryptoKey item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListCryptoKeysResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKey item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKey item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeys(ListCryptoKeysRequest, CallSettings)
public virtual PagedEnumerable ListCryptoKeys(ListCryptoKeysRequest request, CallSettings callSettings = null) Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
ListCryptoKeysRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCryptoKeysResponseCryptoKey |
A pageable sequence of CryptoKey resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ListCryptoKeysRequest request = new ListCryptoKeysRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
VersionView = CryptoKeyVersion.Types.CryptoKeyVersionView.Unspecified,
Filter = "",
OrderBy = "",
};
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListCryptoKeys(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (CryptoKey item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListCryptoKeysResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKey item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKey item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeys(string, string, int?, CallSettings)
public virtual PagedEnumerable ListCryptoKeys(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
to list, in the format |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCryptoKeysResponseCryptoKey |
A pageable sequence of CryptoKey resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListCryptoKeys(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (CryptoKey item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListCryptoKeysResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKey item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKey item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeysAsync(KeyRingName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListCryptoKeysAsync(KeyRingName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
parent |
KeyRingNameRequired. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
to list, in the format |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCryptoKeysResponseCryptoKey |
A pageable asynchronous sequence of CryptoKey resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListCryptoKeysAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CryptoKey item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListCryptoKeysResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKey item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKey item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeysAsync(ListCryptoKeysRequest, CallSettings)
public virtual PagedAsyncEnumerable ListCryptoKeysAsync(ListCryptoKeysRequest request, CallSettings callSettings = null) Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
ListCryptoKeysRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCryptoKeysResponseCryptoKey |
A pageable asynchronous sequence of CryptoKey resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ListCryptoKeysRequest request = new ListCryptoKeysRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
VersionView = CryptoKeyVersion.Types.CryptoKeyVersionView.Unspecified,
Filter = "",
OrderBy = "",
};
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListCryptoKeysAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CryptoKey item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListCryptoKeysResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKey item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKey item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListCryptoKeysAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListCryptoKeysAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
to list, in the format |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCryptoKeysResponseCryptoKey |
A pageable asynchronous sequence of CryptoKey resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListCryptoKeysAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CryptoKey item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListCryptoKeysResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CryptoKey item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (CryptoKey item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListImportJobs(KeyRingName, string, int?, CallSettings)
public virtual PagedEnumerable ListImportJobs(KeyRingName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [ImportJobs][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
parent |
KeyRingNameRequired. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
to list, in the format |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListImportJobsResponseImportJob |
A pageable sequence of ImportJob resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListImportJobs(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (ImportJob item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListImportJobsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ImportJob item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ImportJob item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListImportJobs(ListImportJobsRequest, CallSettings)
public virtual PagedEnumerable ListImportJobs(ListImportJobsRequest request, CallSettings callSettings = null) Lists [ImportJobs][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
request |
ListImportJobsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListImportJobsResponseImportJob |
A pageable sequence of ImportJob resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ListImportJobsRequest request = new ListImportJobsRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListImportJobs(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (ImportJob item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListImportJobsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ImportJob item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ImportJob item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListImportJobs(string, string, int?, CallSettings)
public virtual PagedEnumerable ListImportJobs(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [ImportJobs][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
to list, in the format |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListImportJobsResponseImportJob |
A pageable sequence of ImportJob resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListImportJobs(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (ImportJob item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListImportJobsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ImportJob item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ImportJob item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListImportJobsAsync(KeyRingName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListImportJobsAsync(KeyRingName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [ImportJobs][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
parent |
KeyRingNameRequired. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
to list, in the format |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListImportJobsResponseImportJob |
A pageable asynchronous sequence of ImportJob resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
KeyRingName parent = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]");
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListImportJobsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (ImportJob item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListImportJobsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ImportJob item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ImportJob item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListImportJobsAsync(ListImportJobsRequest, CallSettings)
public virtual PagedAsyncEnumerable ListImportJobsAsync(ListImportJobsRequest request, CallSettings callSettings = null) Lists [ImportJobs][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
request |
ListImportJobsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListImportJobsResponseImportJob |
A pageable asynchronous sequence of ImportJob resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ListImportJobsRequest request = new ListImportJobsRequest
{
ParentAsKeyRingName = KeyRingName.FromProjectLocationKeyRing("[PROJECT]", "[LOCATION]", "[KEY_RING]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListImportJobsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (ImportJob item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListImportJobsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ImportJob item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ImportJob item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListImportJobsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListImportJobsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [ImportJobs][google.cloud.kms.v1.ImportJob].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
to list, in the format |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListImportJobsResponseImportJob |
A pageable asynchronous sequence of ImportJob resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]";
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListImportJobsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (ImportJob item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListImportJobsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (ImportJob item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (ImportJob item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListKeyRings(LocationName, string, int?, CallSettings)
public virtual PagedEnumerable ListKeyRings(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [KeyRings][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListKeyRingsResponseKeyRing |
A pageable sequence of KeyRing resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListKeyRings(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (KeyRing item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListKeyRingsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (KeyRing item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyRing item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListKeyRings(ListKeyRingsRequest, CallSettings)
public virtual PagedEnumerable ListKeyRings(ListKeyRingsRequest request, CallSettings callSettings = null) Lists [KeyRings][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
request |
ListKeyRingsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListKeyRingsResponseKeyRing |
A pageable sequence of KeyRing resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ListKeyRingsRequest request = new ListKeyRingsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListKeyRings(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (KeyRing item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListKeyRingsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (KeyRing item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyRing item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListKeyRings(string, string, int?, CallSettings)
public virtual PagedEnumerable ListKeyRings(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [KeyRings][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListKeyRingsResponseKeyRing |
A pageable sequence of KeyRing resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListKeyRings(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (KeyRing item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListKeyRingsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (KeyRing item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyRing item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListKeyRingsAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListKeyRingsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [KeyRings][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListKeyRingsResponseKeyRing |
A pageable asynchronous sequence of KeyRing resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListKeyRingsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (KeyRing item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListKeyRingsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (KeyRing item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyRing item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListKeyRingsAsync(ListKeyRingsRequest, CallSettings)
public virtual PagedAsyncEnumerable ListKeyRingsAsync(ListKeyRingsRequest request, CallSettings callSettings = null) Lists [KeyRings][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
request |
ListKeyRingsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListKeyRingsResponseKeyRing |
A pageable asynchronous sequence of KeyRing resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ListKeyRingsRequest request = new ListKeyRingsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
OrderBy = "",
};
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListKeyRingsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (KeyRing item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListKeyRingsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (KeyRing item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyRing item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListKeyRingsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListKeyRingsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists [KeyRings][google.cloud.kms.v1.KeyRing].
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The resource name of the location associated with the
[KeyRings][google.cloud.kms.v1.KeyRing], in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListKeyRingsResponseKeyRing |
A pageable asynchronous sequence of KeyRing resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListKeyRingsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (KeyRing item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListKeyRingsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (KeyRing item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (KeyRing item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListRetiredResources(LocationName, string, int?, CallSettings)
public virtual PagedEnumerable ListRetiredResources(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. RetiredResources prevent the reuse of these resource names after deletion.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The project-specific location holding the
[RetiredResources][google.cloud.kms.v1.RetiredResource], in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListRetiredResourcesResponseRetiredResource |
A pageable sequence of RetiredResource resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListRetiredResources(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (RetiredResource item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListRetiredResourcesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RetiredResource item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (RetiredResource item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListRetiredResources(ListRetiredResourcesRequest, CallSettings)
public virtual PagedEnumerable ListRetiredResources(ListRetiredResourcesRequest request, CallSettings callSettings = null) Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. RetiredResources prevent the reuse of these resource names after deletion.
| Parameters | |
|---|---|
| Name | Description |
request |
ListRetiredResourcesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListRetiredResourcesResponseRetiredResource |
A pageable sequence of RetiredResource resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
ListRetiredResourcesRequest request = new ListRetiredResourcesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListRetiredResources(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (RetiredResource item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListRetiredResourcesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RetiredResource item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (RetiredResource item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListRetiredResources(string, string, int?, CallSettings)
public virtual PagedEnumerable ListRetiredResources(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. RetiredResources prevent the reuse of these resource names after deletion.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The project-specific location holding the
[RetiredResources][google.cloud.kms.v1.RetiredResource], in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListRetiredResourcesResponseRetiredResource |
A pageable sequence of RetiredResource resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable response = keyManagementServiceClient.ListRetiredResources(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (RetiredResource item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListRetiredResourcesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RetiredResource item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (RetiredResource item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListRetiredResourcesAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListRetiredResourcesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. RetiredResources prevent the reuse of these resource names after deletion.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The project-specific location holding the
[RetiredResources][google.cloud.kms.v1.RetiredResource], in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListRetiredResourcesResponseRetiredResource |
A pageable asynchronous sequence of RetiredResource resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListRetiredResourcesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (RetiredResource item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListRetiredResourcesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RetiredResource item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (RetiredResource item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListRetiredResourcesAsync(ListRetiredResourcesRequest, CallSettings)
public virtual PagedAsyncEnumerable ListRetiredResourcesAsync(ListRetiredResourcesRequest request, CallSettings callSettings = null) Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. RetiredResources prevent the reuse of these resource names after deletion.
| Parameters | |
|---|---|
| Name | Description |
request |
ListRetiredResourcesRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListRetiredResourcesResponseRetiredResource |
A pageable asynchronous sequence of RetiredResource resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
ListRetiredResourcesRequest request = new ListRetiredResourcesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListRetiredResourcesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (RetiredResource item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListRetiredResourcesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RetiredResource item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (RetiredResource item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListRetiredResourcesAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable ListRetiredResourcesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null) Lists the [RetiredResources][google.cloud.kms.v1.RetiredResource] which are the records of deleted [CryptoKeys][google.cloud.kms.v1.CryptoKey]. RetiredResources prevent the reuse of these resource names after deletion.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The project-specific location holding the
[RetiredResources][google.cloud.kms.v1.RetiredResource], in the format
|
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListRetiredResourcesResponseRetiredResource |
A pageable asynchronous sequence of RetiredResource resources. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable response = keyManagementServiceClient.ListRetiredResourcesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (RetiredResource item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListRetiredResourcesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (RetiredResource item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (RetiredResource item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
MacSign(CryptoKeyVersionName, ByteString, CallSettings)
public virtual MacSignResponse MacSign(CryptoKeyVersionName name, ByteString data, CallSettings callSettings = null)Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, producing a tag that can be verified by another source with the same key.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
data |
ByteStringRequired. The data to sign. The MAC tag is computed over this data field based on the specific algorithm. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
MacSignResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString data = ByteString.Empty;
// Make the request
MacSignResponse response = keyManagementServiceClient.MacSign(name, data);
MacSign(MacSignRequest, CallSettings)
public virtual MacSignResponse MacSign(MacSignRequest request, CallSettings callSettings = null)Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, producing a tag that can be verified by another source with the same key.
| Parameters | |
|---|---|
| Name | Description |
request |
MacSignRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
MacSignResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
MacSignRequest request = new MacSignRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Data = ByteString.Empty,
DataCrc32C = 0L,
};
// Make the request
MacSignResponse response = keyManagementServiceClient.MacSign(request);
MacSign(string, ByteString, CallSettings)
public virtual MacSignResponse MacSign(string name, ByteString data, CallSettings callSettings = null)Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, producing a tag that can be verified by another source with the same key.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
data |
ByteStringRequired. The data to sign. The MAC tag is computed over this data field based on the specific algorithm. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
MacSignResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString data = ByteString.Empty;
// Make the request
MacSignResponse response = keyManagementServiceClient.MacSign(name, data);
MacSignAsync(CryptoKeyVersionName, ByteString, CallSettings)
public virtual Task MacSignAsync(CryptoKeyVersionName name, ByteString data, CallSettings callSettings = null) Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, producing a tag that can be verified by another source with the same key.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
data |
ByteStringRequired. The data to sign. The MAC tag is computed over this data field based on the specific algorithm. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMacSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString data = ByteString.Empty;
// Make the request
MacSignResponse response = await keyManagementServiceClient.MacSignAsync(name, data);
MacSignAsync(CryptoKeyVersionName, ByteString, CancellationToken)
public virtual Task MacSignAsync(CryptoKeyVersionName name, ByteString data, CancellationToken cancellationToken) 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 |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
data |
ByteStringRequired. The data to sign. The MAC tag is computed over this data field based on the specific algorithm. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMacSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString data = ByteString.Empty;
// Make the request
MacSignResponse response = await keyManagementServiceClient.MacSignAsync(name, data);
MacSignAsync(MacSignRequest, CallSettings)
public virtual Task MacSignAsync(MacSignRequest request, CallSettings callSettings = null) Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, producing a tag that can be verified by another source with the same key.
| Parameters | |
|---|---|
| Name | Description |
request |
MacSignRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMacSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
MacSignRequest request = new MacSignRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Data = ByteString.Empty,
DataCrc32C = 0L,
};
// Make the request
MacSignResponse response = await keyManagementServiceClient.MacSignAsync(request);
MacSignAsync(MacSignRequest, CancellationToken)
public virtual Task MacSignAsync(MacSignRequest request, CancellationToken cancellationToken) 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 |
MacSignRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMacSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
MacSignRequest request = new MacSignRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Data = ByteString.Empty,
DataCrc32C = 0L,
};
// Make the request
MacSignResponse response = await keyManagementServiceClient.MacSignAsync(request);
MacSignAsync(string, ByteString, CallSettings)
public virtual Task MacSignAsync(string name, ByteString data, CallSettings callSettings = null) Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, producing a tag that can be verified by another source with the same key.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
data |
ByteStringRequired. The data to sign. The MAC tag is computed over this data field based on the specific algorithm. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMacSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString data = ByteString.Empty;
// Make the request
MacSignResponse response = await keyManagementServiceClient.MacSignAsync(name, data);
MacSignAsync(string, ByteString, CancellationToken)
public virtual Task MacSignAsync(string name, ByteString data, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. |
data |
ByteStringRequired. The data to sign. The MAC tag is computed over this data field based on the specific algorithm. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMacSignResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString data = ByteString.Empty;
// Make the request
MacSignResponse response = await keyManagementServiceClient.MacSignAsync(name, data);
MacVerify(CryptoKeyVersionName, ByteString, ByteString, CallSettings)
public virtual MacVerifyResponse MacVerify(CryptoKeyVersionName name, ByteString data, ByteString mac, CallSettings callSettings = null)Verifies MAC tag using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns a response that indicates whether or not the verification was successful.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for verification. |
data |
ByteStringRequired. The data used previously as a [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate the MAC tag. |
mac |
ByteStringRequired. The signature to verify. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
MacVerifyResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString data = ByteString.Empty;
ByteString mac = ByteString.Empty;
// Make the request
MacVerifyResponse response = keyManagementServiceClient.MacVerify(name, data, mac);
MacVerify(MacVerifyRequest, CallSettings)
public virtual MacVerifyResponse MacVerify(MacVerifyRequest request, CallSettings callSettings = null)Verifies MAC tag using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns a response that indicates whether or not the verification was successful.
| Parameters | |
|---|---|
| Name | Description |
request |
MacVerifyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
MacVerifyResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
MacVerifyRequest request = new MacVerifyRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Data = ByteString.Empty,
DataCrc32C = 0L,
Mac = ByteString.Empty,
MacCrc32C = 0L,
};
// Make the request
MacVerifyResponse response = keyManagementServiceClient.MacVerify(request);
MacVerify(string, ByteString, ByteString, CallSettings)
public virtual MacVerifyResponse MacVerify(string name, ByteString data, ByteString mac, CallSettings callSettings = null)Verifies MAC tag using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns a response that indicates whether or not the verification was successful.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for verification. |
data |
ByteStringRequired. The data used previously as a [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate the MAC tag. |
mac |
ByteStringRequired. The signature to verify. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
MacVerifyResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString data = ByteString.Empty;
ByteString mac = ByteString.Empty;
// Make the request
MacVerifyResponse response = keyManagementServiceClient.MacVerify(name, data, mac);
MacVerifyAsync(CryptoKeyVersionName, ByteString, ByteString, CallSettings)
public virtual Task MacVerifyAsync(CryptoKeyVersionName name, ByteString data, ByteString mac, CallSettings callSettings = null) Verifies MAC tag using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns a response that indicates whether or not the verification was successful.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for verification. |
data |
ByteStringRequired. The data used previously as a [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate the MAC tag. |
mac |
ByteStringRequired. The signature to verify. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMacVerifyResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString data = ByteString.Empty;
ByteString mac = ByteString.Empty;
// Make the request
MacVerifyResponse response = await keyManagementServiceClient.MacVerifyAsync(name, data, mac);
MacVerifyAsync(CryptoKeyVersionName, ByteString, ByteString, CancellationToken)
public virtual Task MacVerifyAsync(CryptoKeyVersionName name, ByteString data, ByteString mac, CancellationToken cancellationToken) 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 |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for verification. |
data |
ByteStringRequired. The data used previously as a [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate the MAC tag. |
mac |
ByteStringRequired. The signature to verify. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMacVerifyResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
ByteString data = ByteString.Empty;
ByteString mac = ByteString.Empty;
// Make the request
MacVerifyResponse response = await keyManagementServiceClient.MacVerifyAsync(name, data, mac);
MacVerifyAsync(MacVerifyRequest, CallSettings)
public virtual Task MacVerifyAsync(MacVerifyRequest request, CallSettings callSettings = null) Verifies MAC tag using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns a response that indicates whether or not the verification was successful.
| Parameters | |
|---|---|
| Name | Description |
request |
MacVerifyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMacVerifyResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
MacVerifyRequest request = new MacVerifyRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Data = ByteString.Empty,
DataCrc32C = 0L,
Mac = ByteString.Empty,
MacCrc32C = 0L,
};
// Make the request
MacVerifyResponse response = await keyManagementServiceClient.MacVerifyAsync(request);
MacVerifyAsync(MacVerifyRequest, CancellationToken)
public virtual Task MacVerifyAsync(MacVerifyRequest request, CancellationToken cancellationToken) 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 |
MacVerifyRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMacVerifyResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
MacVerifyRequest request = new MacVerifyRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
Data = ByteString.Empty,
DataCrc32C = 0L,
Mac = ByteString.Empty,
MacCrc32C = 0L,
};
// Make the request
MacVerifyResponse response = await keyManagementServiceClient.MacVerifyAsync(request);
MacVerifyAsync(string, ByteString, ByteString, CallSettings)
public virtual Task MacVerifyAsync(string name, ByteString data, ByteString mac, CallSettings callSettings = null) Verifies MAC tag using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns a response that indicates whether or not the verification was successful.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for verification. |
data |
ByteStringRequired. The data used previously as a [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate the MAC tag. |
mac |
ByteStringRequired. The signature to verify. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskMacVerifyResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString data = ByteString.Empty;
ByteString mac = ByteString.Empty;
// Make the request
MacVerifyResponse response = await keyManagementServiceClient.MacVerifyAsync(name, data, mac);
MacVerifyAsync(string, ByteString, ByteString, CancellationToken)
public virtual Task MacVerifyAsync(string name, ByteString data, ByteString mac, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for verification. |
data |
ByteStringRequired. The data used previously as a [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate the MAC tag. |
mac |
ByteStringRequired. The signature to verify. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskMacVerifyResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
ByteString data = ByteString.Empty;
ByteString mac = ByteString.Empty;
// Make the request
MacVerifyResponse response = await keyManagementServiceClient.MacVerifyAsync(name, data, mac);
PollOnceDeleteCryptoKey(string, CallSettings)
public virtual Operation PollOnceDeleteCryptoKey(string operationName, CallSettings callSettings = null) Poll an operation once, using an operationName from a previous invocation of DeleteCryptoKey.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationEmptyDeleteCryptoKeyMetadata |
The result of polling the operation. |
PollOnceDeleteCryptoKeyAsync(string, CallSettings)
public virtual Task> PollOnceDeleteCryptoKeyAsync(string operationName, CallSettings callSettings = null) Asynchronously poll an operation once, using an operationName from a previous invocation of
DeleteCryptoKey.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyMetadata |
A task representing the result of polling the operation. |
PollOnceDeleteCryptoKeyVersion(string, CallSettings)
public virtual Operation PollOnceDeleteCryptoKeyVersion(string operationName, CallSettings callSettings = null) Poll an operation once, using an operationName from a previous invocation of
DeleteCryptoKeyVersion.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
OperationEmptyDeleteCryptoKeyVersionMetadata |
The result of polling the operation. |
PollOnceDeleteCryptoKeyVersionAsync(string, CallSettings)
public virtual Task> PollOnceDeleteCryptoKeyVersionAsync(string operationName, CallSettings callSettings = null) Asynchronously poll an operation once, using an operationName from a previous invocation of
DeleteCryptoKeyVersion.
| Parameters | |
|---|---|
| Name | Description |
operationName |
stringThe name of a previously invoked operation. Must not be |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskOperationEmptyDeleteCryptoKeyVersionMetadata |
A task representing the result of polling the operation. |
RawDecrypt(RawDecryptRequest, CallSettings)
public virtual RawDecryptResponse RawDecrypt(RawDecryptRequest request, CallSettings callSettings = null)Decrypts data that was originally encrypted using a raw cryptographic mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
RawDecryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
RawDecryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
RawDecryptRequest request = new RawDecryptRequest
{
Name = "",
Ciphertext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
InitializationVector = ByteString.Empty,
TagLength = 0,
CiphertextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawDecryptResponse response = keyManagementServiceClient.RawDecrypt(request);
RawDecryptAsync(RawDecryptRequest, CallSettings)
public virtual Task RawDecryptAsync(RawDecryptRequest request, CallSettings callSettings = null) Decrypts data that was originally encrypted using a raw cryptographic mechanism. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
RawDecryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRawDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RawDecryptRequest request = new RawDecryptRequest
{
Name = "",
Ciphertext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
InitializationVector = ByteString.Empty,
TagLength = 0,
CiphertextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawDecryptResponse response = await keyManagementServiceClient.RawDecryptAsync(request);
RawDecryptAsync(RawDecryptRequest, CancellationToken)
public virtual Task RawDecryptAsync(RawDecryptRequest request, CancellationToken cancellationToken) 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 |
RawDecryptRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskRawDecryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RawDecryptRequest request = new RawDecryptRequest
{
Name = "",
Ciphertext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
InitializationVector = ByteString.Empty,
TagLength = 0,
CiphertextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawDecryptResponse response = await keyManagementServiceClient.RawDecryptAsync(request);
RawEncrypt(RawEncryptRequest, CallSettings)
public virtual RawEncryptResponse RawEncrypt(RawEncryptRequest request, CallSettings callSettings = null)Encrypts data using portable cryptographic primitives. Most users should choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than their raw counterparts. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
RawEncryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
RawEncryptResponse |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
RawEncryptRequest request = new RawEncryptRequest
{
Name = "",
Plaintext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
PlaintextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVector = ByteString.Empty,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawEncryptResponse response = keyManagementServiceClient.RawEncrypt(request);
RawEncryptAsync(RawEncryptRequest, CallSettings)
public virtual Task RawEncryptAsync(RawEncryptRequest request, CallSettings callSettings = null) Encrypts data using portable cryptographic primitives. Most users should choose [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] rather than their raw counterparts. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be [RAW_ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.RAW_ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
RawEncryptRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskRawEncryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RawEncryptRequest request = new RawEncryptRequest
{
Name = "",
Plaintext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
PlaintextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVector = ByteString.Empty,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawEncryptResponse response = await keyManagementServiceClient.RawEncryptAsync(request);
RawEncryptAsync(RawEncryptRequest, CancellationToken)
public virtual Task RawEncryptAsync(RawEncryptRequest request, CancellationToken cancellationToken) 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 |
RawEncryptRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskRawEncryptResponse |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RawEncryptRequest request = new RawEncryptRequest
{
Name = "",
Plaintext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
PlaintextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVector = ByteString.Empty,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawEncryptResponse response = await keyManagementServiceClient.RawEncryptAsync(request);
RestoreCryptoKeyVersion(CryptoKeyVersionName, CallSettings)
public virtual CryptoKeyVersion RestoreCryptoKeyVersion(CryptoKeyVersionName name, CallSettings callSettings = null)Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state.
Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.RestoreCryptoKeyVersion(name);
RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest, CallSettings)
public virtual CryptoKeyVersion RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request, CallSettings callSettings = null)Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state.
Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.
| Parameters | |
|---|---|
| Name | Description |
request |
RestoreCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
RestoreCryptoKeyVersionRequest request = new RestoreCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.RestoreCryptoKeyVersion(request);
RestoreCryptoKeyVersion(string, CallSettings)
public virtual CryptoKeyVersion RestoreCryptoKeyVersion(string name, CallSettings callSettings = null)Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state.
Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.RestoreCryptoKeyVersion(name);
RestoreCryptoKeyVersionAsync(CryptoKeyVersionName, CallSettings)
public virtual Task RestoreCryptoKeyVersionAsync(CryptoKeyVersionName name, CallSettings callSettings = null) Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state.
Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.RestoreCryptoKeyVersionAsync(name);
RestoreCryptoKeyVersionAsync(CryptoKeyVersionName, CancellationToken)
public virtual Task RestoreCryptoKeyVersionAsync(CryptoKeyVersionName name, CancellationToken cancellationToken) 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 |
name |
CryptoKeyVersionNameRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersionName name = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.RestoreCryptoKeyVersionAsync(name);
RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest, CallSettings)
public virtual Task RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest request, CallSettings callSettings = null) Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state.
Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.
| Parameters | |
|---|---|
| Name | Description |
request |
RestoreCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RestoreCryptoKeyVersionRequest request = new RestoreCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.RestoreCryptoKeyVersionAsync(request);
RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest, CancellationToken)
public virtual Task RestoreCryptoKeyVersionAsync(RestoreCryptoKeyVersionRequest request, CancellationToken cancellationToken) 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 |
RestoreCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RestoreCryptoKeyVersionRequest request = new RestoreCryptoKeyVersionRequest
{
CryptoKeyVersionName = CryptoKeyVersionName.FromProjectLocationKeyRingCryptoKeyCryptoKeyVersion("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.RestoreCryptoKeyVersionAsync(request);
RestoreCryptoKeyVersionAsync(string, CallSettings)
public virtual Task RestoreCryptoKeyVersionAsync(string name, CallSettings callSettings = null) Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state.
Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.RestoreCryptoKeyVersionAsync(name);
RestoreCryptoKeyVersionAsync(string, CancellationToken)
public virtual Task RestoreCryptoKeyVersionAsync(string name, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]/cryptoKeyVersions/[CRYPTO_KEY_VERSION]";
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.RestoreCryptoKeyVersionAsync(name);
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
| Returns | |
|---|---|
| Type | Description |
Task |
A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.
UpdateCryptoKey(CryptoKey, FieldMask, CallSettings)
public virtual CryptoKey UpdateCryptoKey(CryptoKey cryptoKey, FieldMask updateMask, CallSettings callSettings = null)Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
cryptoKey |
CryptoKeyRequired. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. |
updateMask |
FieldMaskRequired. List of fields to be updated in this request. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKey cryptoKey = new CryptoKey();
FieldMask updateMask = new FieldMask();
// Make the request
CryptoKey response = keyManagementServiceClient.UpdateCryptoKey(cryptoKey, updateMask);
UpdateCryptoKey(UpdateCryptoKeyRequest, CallSettings)
public virtual CryptoKey UpdateCryptoKey(UpdateCryptoKeyRequest request, CallSettings callSettings = null)Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCryptoKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
UpdateCryptoKeyRequest request = new UpdateCryptoKeyRequest
{
CryptoKey = new CryptoKey(),
UpdateMask = new FieldMask(),
};
// Make the request
CryptoKey response = keyManagementServiceClient.UpdateCryptoKey(request);
UpdateCryptoKeyAsync(CryptoKey, FieldMask, CallSettings)
public virtual Task UpdateCryptoKeyAsync(CryptoKey cryptoKey, FieldMask updateMask, CallSettings callSettings = null) Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
cryptoKey |
CryptoKeyRequired. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. |
updateMask |
FieldMaskRequired. List of fields to be updated in this request. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKey cryptoKey = new CryptoKey();
FieldMask updateMask = new FieldMask();
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyAsync(cryptoKey, updateMask);
UpdateCryptoKeyAsync(CryptoKey, FieldMask, CancellationToken)
public virtual Task UpdateCryptoKeyAsync(CryptoKey cryptoKey, FieldMask updateMask, CancellationToken cancellationToken) Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
cryptoKey |
CryptoKeyRequired. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values. |
updateMask |
FieldMaskRequired. List of fields to be updated in this request. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKey cryptoKey = new CryptoKey();
FieldMask updateMask = new FieldMask();
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyAsync(cryptoKey, updateMask);
UpdateCryptoKeyAsync(UpdateCryptoKeyRequest, CallSettings)
public virtual Task UpdateCryptoKeyAsync(UpdateCryptoKeyRequest request, CallSettings callSettings = null) Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCryptoKeyRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCryptoKeyRequest request = new UpdateCryptoKeyRequest
{
CryptoKey = new CryptoKey(),
UpdateMask = new FieldMask(),
};
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyAsync(request);
UpdateCryptoKeyAsync(UpdateCryptoKeyRequest, CancellationToken)
public virtual Task UpdateCryptoKeyAsync(UpdateCryptoKeyRequest request, CancellationToken cancellationToken) Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCryptoKeyRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCryptoKeyRequest request = new UpdateCryptoKeyRequest
{
CryptoKey = new CryptoKey(),
UpdateMask = new FieldMask(),
};
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyAsync(request);
UpdateCryptoKeyPrimaryVersion(CryptoKeyName, string, CallSettings)
public virtual CryptoKey UpdateCryptoKeyPrimaryVersion(CryptoKeyName name, string cryptoKeyVersionId, CallSettings callSettings = null)Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
Returns an error if called on a key whose purpose is not [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. |
cryptoKeyVersionId |
stringRequired. The id of the child [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
string cryptoKeyVersionId = "";
// Make the request
CryptoKey response = keyManagementServiceClient.UpdateCryptoKeyPrimaryVersion(name, cryptoKeyVersionId);
UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest, CallSettings)
public virtual CryptoKey UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request, CallSettings callSettings = null)Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
Returns an error if called on a key whose purpose is not [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCryptoKeyPrimaryVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
UpdateCryptoKeyPrimaryVersionRequest request = new UpdateCryptoKeyPrimaryVersionRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
CryptoKeyVersionId = "",
};
// Make the request
CryptoKey response = keyManagementServiceClient.UpdateCryptoKeyPrimaryVersion(request);
UpdateCryptoKeyPrimaryVersion(string, string, CallSettings)
public virtual CryptoKey UpdateCryptoKeyPrimaryVersion(string name, string cryptoKeyVersionId, CallSettings callSettings = null)Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
Returns an error if called on a key whose purpose is not [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. |
cryptoKeyVersionId |
stringRequired. The id of the child [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKey |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
string cryptoKeyVersionId = "";
// Make the request
CryptoKey response = keyManagementServiceClient.UpdateCryptoKeyPrimaryVersion(name, cryptoKeyVersionId);
UpdateCryptoKeyPrimaryVersionAsync(CryptoKeyName, string, CallSettings)
public virtual Task UpdateCryptoKeyPrimaryVersionAsync(CryptoKeyName name, string cryptoKeyVersionId, CallSettings callSettings = null) Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
Returns an error if called on a key whose purpose is not [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
CryptoKeyNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. |
cryptoKeyVersionId |
stringRequired. The id of the child [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
string cryptoKeyVersionId = "";
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyPrimaryVersionAsync(name, cryptoKeyVersionId);
UpdateCryptoKeyPrimaryVersionAsync(CryptoKeyName, string, CancellationToken)
public virtual Task UpdateCryptoKeyPrimaryVersionAsync(CryptoKeyName name, string cryptoKeyVersionId, CancellationToken cancellationToken) 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 |
name |
CryptoKeyNameRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. |
cryptoKeyVersionId |
stringRequired. The id of the child [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyName name = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
string cryptoKeyVersionId = "";
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyPrimaryVersionAsync(name, cryptoKeyVersionId);
UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest, CallSettings)
public virtual Task UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest request, CallSettings callSettings = null) Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
Returns an error if called on a key whose purpose is not [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCryptoKeyPrimaryVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCryptoKeyPrimaryVersionRequest request = new UpdateCryptoKeyPrimaryVersionRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
CryptoKeyVersionId = "",
};
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyPrimaryVersionAsync(request);
UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest, CancellationToken)
public virtual Task UpdateCryptoKeyPrimaryVersionAsync(UpdateCryptoKeyPrimaryVersionRequest request, CancellationToken cancellationToken) 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 |
UpdateCryptoKeyPrimaryVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCryptoKeyPrimaryVersionRequest request = new UpdateCryptoKeyPrimaryVersionRequest
{
CryptoKeyName = CryptoKeyName.FromProjectLocationKeyRingCryptoKey("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"),
CryptoKeyVersionId = "",
};
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyPrimaryVersionAsync(request);
UpdateCryptoKeyPrimaryVersionAsync(string, string, CallSettings)
public virtual Task UpdateCryptoKeyPrimaryVersionAsync(string name, string cryptoKeyVersionId, CallSettings callSettings = null) Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
Returns an error if called on a key whose purpose is not [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. |
cryptoKeyVersionId |
stringRequired. The id of the child [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
string cryptoKeyVersionId = "";
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyPrimaryVersionAsync(name, cryptoKeyVersionId);
UpdateCryptoKeyPrimaryVersionAsync(string, string, CancellationToken)
public virtual Task UpdateCryptoKeyPrimaryVersionAsync(string name, string cryptoKeyVersionId, CancellationToken cancellationToken) 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 |
name |
stringRequired. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. |
cryptoKeyVersionId |
stringRequired. The id of the child [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKey |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[CRYPTO_KEY]";
string cryptoKeyVersionId = "";
// Make the request
CryptoKey response = await keyManagementServiceClient.UpdateCryptoKeyPrimaryVersionAsync(name, cryptoKeyVersionId);
UpdateCryptoKeyVersion(CryptoKeyVersion, FieldMask, CallSettings)
public virtual CryptoKeyVersion UpdateCryptoKeyVersion(CryptoKeyVersion cryptoKeyVersion, FieldMask updateMask, CallSettings callSettings = null)Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata.
[state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to move between other states.
| Parameters | |
|---|---|
| Name | Description |
cryptoKeyVersion |
CryptoKeyVersionRequired. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with updated values. |
updateMask |
FieldMaskRequired. List of fields to be updated in this request. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
FieldMask updateMask = new FieldMask();
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.UpdateCryptoKeyVersion(cryptoKeyVersion, updateMask);
UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest, CallSettings)
public virtual CryptoKeyVersion UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request, CallSettings callSettings = null)Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata.
[state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to move between other states.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CryptoKeyVersion |
The RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
UpdateCryptoKeyVersionRequest request = new UpdateCryptoKeyVersionRequest
{
CryptoKeyVersion = new CryptoKeyVersion(),
UpdateMask = new FieldMask(),
};
// Make the request
CryptoKeyVersion response = keyManagementServiceClient.UpdateCryptoKeyVersion(request);
UpdateCryptoKeyVersionAsync(CryptoKeyVersion, FieldMask, CallSettings)
public virtual Task UpdateCryptoKeyVersionAsync(CryptoKeyVersion cryptoKeyVersion, FieldMask updateMask, CallSettings callSettings = null) Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata.
[state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to move between other states.
| Parameters | |
|---|---|
| Name | Description |
cryptoKeyVersion |
CryptoKeyVersionRequired. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with updated values. |
updateMask |
FieldMaskRequired. List of fields to be updated in this request. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
FieldMask updateMask = new FieldMask();
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.UpdateCryptoKeyVersionAsync(cryptoKeyVersion, updateMask);
UpdateCryptoKeyVersionAsync(CryptoKeyVersion, FieldMask, CancellationToken)
public virtual Task UpdateCryptoKeyVersionAsync(CryptoKeyVersion cryptoKeyVersion, FieldMask updateMask, CancellationToken cancellationToken) 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 |
cryptoKeyVersion |
CryptoKeyVersionRequired. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with updated values. |
updateMask |
FieldMaskRequired. List of fields to be updated in this request. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
CryptoKeyVersion cryptoKeyVersion = new CryptoKeyVersion();
FieldMask updateMask = new FieldMask();
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.UpdateCryptoKeyVersionAsync(cryptoKeyVersion, updateMask);
UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest, CallSettings)
public virtual Task UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest request, CallSettings callSettings = null) Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata.
[state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to move between other states.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCryptoKeyVersionRequest request = new UpdateCryptoKeyVersionRequest
{
CryptoKeyVersion = new CryptoKeyVersion(),
UpdateMask = new FieldMask(),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.UpdateCryptoKeyVersionAsync(request);
UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest, CancellationToken)
public virtual Task UpdateCryptoKeyVersionAsync(UpdateCryptoKeyVersionRequest request, CancellationToken cancellationToken) 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 |
UpdateCryptoKeyVersionRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCryptoKeyVersion |
A Task containing the RPC response. |
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateCryptoKeyVersionRequest request = new UpdateCryptoKeyVersionRequest
{
CryptoKeyVersion = new CryptoKeyVersion(),
UpdateMask = new FieldMask(),
};
// Make the request
CryptoKeyVersion response = await keyManagementServiceClient.UpdateCryptoKeyVersionAsync(request);