Class KeyManagementServiceGrpc.KeyManagementServiceFutureStub (2.54.0)

public static final class KeyManagementServiceGrpc.KeyManagementServiceFutureStub extends AbstractFutureStub<KeyManagementServiceGrpc.KeyManagementServiceFutureStub>

A stub to allow clients to do ListenableFuture-style rpc calls to service KeyManagementService.

Google Cloud Key Management Service Manages cryptographic keys and operations using those keys. Implements a REST model with the following objects:

Inheritance

java.lang.Object > io.grpc.stub.AbstractStub > io.grpc.stub.AbstractFutureStub > KeyManagementServiceGrpc.KeyManagementServiceFutureStub

Methods

asymmetricDecrypt(AsymmetricDecryptRequest request)

public ListenableFuture<AsymmetricDecryptResponse> asymmetricDecrypt(AsymmetricDecryptRequest request)

Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT.

Parameter
Name Description
request AsymmetricDecryptRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<AsymmetricDecryptResponse>

asymmetricSign(AsymmetricSignRequest request)

public ListenableFuture<AsymmetricSignResponse> asymmetricSign(AsymmetricSignRequest request)

Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from GetPublicKey.

Parameter
Name Description
request AsymmetricSignRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<AsymmetricSignResponse>

build(Channel channel, CallOptions callOptions)

protected KeyManagementServiceGrpc.KeyManagementServiceFutureStub build(Channel channel, CallOptions callOptions)
Parameters
Name Description
channel io.grpc.Channel
callOptions io.grpc.CallOptions
Returns
Type Description
KeyManagementServiceGrpc.KeyManagementServiceFutureStub
Overrides
io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)

createCryptoKey(CreateCryptoKeyRequest request)

public ListenableFuture<CryptoKey> createCryptoKey(CreateCryptoKeyRequest request)

Create a new CryptoKey within a KeyRing. CryptoKey.purpose and CryptoKey.version_template.algorithm are required.

Parameter
Name Description
request CreateCryptoKeyRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKey>

createCryptoKeyVersion(CreateCryptoKeyVersionRequest request)

public ListenableFuture<CryptoKeyVersion> createCryptoKeyVersion(CreateCryptoKeyVersionRequest request)

Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next sequential id. If unset, state will be set to ENABLED.

Parameter
Name Description
request CreateCryptoKeyVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKeyVersion>

createImportJob(CreateImportJobRequest request)

public ListenableFuture<ImportJob> createImportJob(CreateImportJobRequest request)

Create a new ImportJob within a KeyRing. ImportJob.import_method is required.

Parameter
Name Description
request CreateImportJobRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ImportJob>

createKeyRing(CreateKeyRingRequest request)

public ListenableFuture<KeyRing> createKeyRing(CreateKeyRingRequest request)

Create a new KeyRing in a given Project and Location.

Parameter
Name Description
request CreateKeyRingRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<KeyRing>

decrypt(DecryptRequest request)

public ListenableFuture<DecryptResponse> decrypt(DecryptRequest request)

Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT.

Parameter
Name Description
request DecryptRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<DecryptResponse>

destroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request)

public ListenableFuture<CryptoKeyVersion> destroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request)

Schedule a CryptoKeyVersion for destruction. Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED, and destroy_time will be set to the time destroy_scheduled_duration in the future. At that time, the state will automatically change to DESTROYED, and the key material will be irrevocably destroyed. Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process.

Parameter
Name Description
request DestroyCryptoKeyVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKeyVersion>

encrypt(EncryptRequest request)

public ListenableFuture<EncryptResponse> encrypt(EncryptRequest request)

Encrypts data, so that it can only be recovered by a call to Decrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT.

Parameter
Name Description
request EncryptRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<EncryptResponse>

generateRandomBytes(GenerateRandomBytesRequest request)

public ListenableFuture<GenerateRandomBytesResponse> generateRandomBytes(GenerateRandomBytesRequest request)

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

Parameter
Name Description
request GenerateRandomBytesRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<GenerateRandomBytesResponse>

getCryptoKey(GetCryptoKeyRequest request)

public ListenableFuture<CryptoKey> getCryptoKey(GetCryptoKeyRequest request)

Returns metadata for a given CryptoKey, as well as its primary CryptoKeyVersion.

Parameter
Name Description
request GetCryptoKeyRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKey>

getCryptoKeyVersion(GetCryptoKeyVersionRequest request)

public ListenableFuture<CryptoKeyVersion> getCryptoKeyVersion(GetCryptoKeyVersionRequest request)

Returns metadata for a given CryptoKeyVersion.

Parameter
Name Description
request GetCryptoKeyVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKeyVersion>

getImportJob(GetImportJobRequest request)

public ListenableFuture<ImportJob> getImportJob(GetImportJobRequest request)

Returns metadata for a given ImportJob.

Parameter
Name Description
request GetImportJobRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ImportJob>

getKeyRing(GetKeyRingRequest request)

public ListenableFuture<KeyRing> getKeyRing(GetKeyRingRequest request)

Returns metadata for a given KeyRing.

Parameter
Name Description
request GetKeyRingRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<KeyRing>

getPublicKey(GetPublicKeyRequest request)

public ListenableFuture<PublicKey> getPublicKey(GetPublicKeyRequest request)

Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT.

Parameter
Name Description
request GetPublicKeyRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<PublicKey>

importCryptoKeyVersion(ImportCryptoKeyVersionRequest request)

public ListenableFuture<CryptoKeyVersion> importCryptoKeyVersion(ImportCryptoKeyVersionRequest request)

Import wrapped key material into a CryptoKeyVersion. All requests must specify a CryptoKey. If a CryptoKeyVersion is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the CryptoKey.

Parameter
Name Description
request ImportCryptoKeyVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKeyVersion>

listCryptoKeyVersions(ListCryptoKeyVersionsRequest request)

public ListenableFuture<ListCryptoKeyVersionsResponse> listCryptoKeyVersions(ListCryptoKeyVersionsRequest request)

Lists CryptoKeyVersions.

Parameter
Name Description
request ListCryptoKeyVersionsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListCryptoKeyVersionsResponse>

listCryptoKeys(ListCryptoKeysRequest request)

public ListenableFuture<ListCryptoKeysResponse> listCryptoKeys(ListCryptoKeysRequest request)

Lists CryptoKeys.

Parameter
Name Description
request ListCryptoKeysRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListCryptoKeysResponse>

listImportJobs(ListImportJobsRequest request)

public ListenableFuture<ListImportJobsResponse> listImportJobs(ListImportJobsRequest request)

Lists ImportJobs.

Parameter
Name Description
request ListImportJobsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListImportJobsResponse>

listKeyRings(ListKeyRingsRequest request)

public ListenableFuture<ListKeyRingsResponse> listKeyRings(ListKeyRingsRequest request)

Lists KeyRings.

Parameter
Name Description
request ListKeyRingsRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<ListKeyRingsResponse>

macSign(MacSignRequest request)

public ListenableFuture<MacSignResponse> macSign(MacSignRequest request)

Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.

Parameter
Name Description
request MacSignRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<MacSignResponse>

macVerify(MacVerifyRequest request)

public ListenableFuture<MacVerifyResponse> macVerify(MacVerifyRequest request)

Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful.

Parameter
Name Description
request MacVerifyRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<MacVerifyResponse>

rawDecrypt(RawDecryptRequest request)

public ListenableFuture<RawDecryptResponse> rawDecrypt(RawDecryptRequest request)

Decrypts data that was originally encrypted using a raw cryptographic mechanism. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.

Parameter
Name Description
request RawDecryptRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<RawDecryptResponse>

rawEncrypt(RawEncryptRequest request)

public ListenableFuture<RawEncryptResponse> rawEncrypt(RawEncryptRequest request)

Encrypts data using portable cryptographic primitives. Most users should choose Encrypt and Decrypt rather than their raw counterparts. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.

Parameter
Name Description
request RawEncryptRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<RawEncryptResponse>

restoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request)

public ListenableFuture<CryptoKeyVersion> restoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request)

Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state. Upon restoration of the CryptoKeyVersion, state will be set to DISABLED, and destroy_time will be cleared.

Parameter
Name Description
request RestoreCryptoKeyVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKeyVersion>

updateCryptoKey(UpdateCryptoKeyRequest request)

public ListenableFuture<CryptoKey> updateCryptoKey(UpdateCryptoKeyRequest request)

Update a CryptoKey.

Parameter
Name Description
request UpdateCryptoKeyRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKey>

updateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request)

public ListenableFuture<CryptoKey> updateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request)

Update the version of a CryptoKey that will be used in Encrypt. Returns an error if called on a key whose purpose is not ENCRYPT_DECRYPT.

Parameter
Name Description
request UpdateCryptoKeyPrimaryVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKey>

updateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request)

public ListenableFuture<CryptoKeyVersion> updateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request)

Update a CryptoKeyVersion's metadata. state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states.

Parameter
Name Description
request UpdateCryptoKeyVersionRequest
Returns
Type Description
com.google.common.util.concurrent.ListenableFuture<CryptoKeyVersion>