Interface KeyManagementServiceGrpc.AsyncService (2.30.0)

public static interface KeyManagementServiceGrpc.AsyncService

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

Methods

asymmetricDecrypt(AsymmetricDecryptRequest request, StreamObserver<AsymmetricDecryptResponse> responseObserver)

public default void asymmetricDecrypt(AsymmetricDecryptRequest request, StreamObserver<AsymmetricDecryptResponse> responseObserver)

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

Parameters
NameDescription
requestAsymmetricDecryptRequest
responseObserverio.grpc.stub.StreamObserver<AsymmetricDecryptResponse>

asymmetricSign(AsymmetricSignRequest request, StreamObserver<AsymmetricSignResponse> responseObserver)

public default void asymmetricSign(AsymmetricSignRequest request, StreamObserver<AsymmetricSignResponse> responseObserver)

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

Parameters
NameDescription
requestAsymmetricSignRequest
responseObserverio.grpc.stub.StreamObserver<AsymmetricSignResponse>

createCryptoKey(CreateCryptoKeyRequest request, StreamObserver<CryptoKey> responseObserver)

public default void createCryptoKey(CreateCryptoKeyRequest request, StreamObserver<CryptoKey> responseObserver)

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

Parameters
NameDescription
requestCreateCryptoKeyRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKey>

createCryptoKeyVersion(CreateCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

public default void createCryptoKeyVersion(CreateCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

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

Parameters
NameDescription
requestCreateCryptoKeyVersionRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKeyVersion>

createImportJob(CreateImportJobRequest request, StreamObserver<ImportJob> responseObserver)

public default void createImportJob(CreateImportJobRequest request, StreamObserver<ImportJob> responseObserver)

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

Parameters
NameDescription
requestCreateImportJobRequest
responseObserverio.grpc.stub.StreamObserver<ImportJob>

createKeyRing(CreateKeyRingRequest request, StreamObserver<KeyRing> responseObserver)

public default void createKeyRing(CreateKeyRingRequest request, StreamObserver<KeyRing> responseObserver)

Create a new KeyRing in a given Project and Location.

Parameters
NameDescription
requestCreateKeyRingRequest
responseObserverio.grpc.stub.StreamObserver<KeyRing>

decrypt(DecryptRequest request, StreamObserver<DecryptResponse> responseObserver)

public default void decrypt(DecryptRequest request, StreamObserver<DecryptResponse> responseObserver)

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

Parameters
NameDescription
requestDecryptRequest
responseObserverio.grpc.stub.StreamObserver<DecryptResponse>

destroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

public default void destroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

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.

Parameters
NameDescription
requestDestroyCryptoKeyVersionRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKeyVersion>

encrypt(EncryptRequest request, StreamObserver<EncryptResponse> responseObserver)

public default void encrypt(EncryptRequest request, StreamObserver<EncryptResponse> responseObserver)

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

Parameters
NameDescription
requestEncryptRequest
responseObserverio.grpc.stub.StreamObserver<EncryptResponse>

generateRandomBytes(GenerateRandomBytesRequest request, StreamObserver<GenerateRandomBytesResponse> responseObserver)

public default void generateRandomBytes(GenerateRandomBytesRequest request, StreamObserver<GenerateRandomBytesResponse> responseObserver)

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

Parameters
NameDescription
requestGenerateRandomBytesRequest
responseObserverio.grpc.stub.StreamObserver<GenerateRandomBytesResponse>

getCryptoKey(GetCryptoKeyRequest request, StreamObserver<CryptoKey> responseObserver)

public default void getCryptoKey(GetCryptoKeyRequest request, StreamObserver<CryptoKey> responseObserver)

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

Parameters
NameDescription
requestGetCryptoKeyRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKey>

getCryptoKeyVersion(GetCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

public default void getCryptoKeyVersion(GetCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

Returns metadata for a given CryptoKeyVersion.

Parameters
NameDescription
requestGetCryptoKeyVersionRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKeyVersion>

getImportJob(GetImportJobRequest request, StreamObserver<ImportJob> responseObserver)

public default void getImportJob(GetImportJobRequest request, StreamObserver<ImportJob> responseObserver)

Returns metadata for a given ImportJob.

Parameters
NameDescription
requestGetImportJobRequest
responseObserverio.grpc.stub.StreamObserver<ImportJob>

getKeyRing(GetKeyRingRequest request, StreamObserver<KeyRing> responseObserver)

public default void getKeyRing(GetKeyRingRequest request, StreamObserver<KeyRing> responseObserver)

Returns metadata for a given KeyRing.

Parameters
NameDescription
requestGetKeyRingRequest
responseObserverio.grpc.stub.StreamObserver<KeyRing>

getPublicKey(GetPublicKeyRequest request, StreamObserver<PublicKey> responseObserver)

public default void getPublicKey(GetPublicKeyRequest request, StreamObserver<PublicKey> responseObserver)

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

Parameters
NameDescription
requestGetPublicKeyRequest
responseObserverio.grpc.stub.StreamObserver<PublicKey>

importCryptoKeyVersion(ImportCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

public default void importCryptoKeyVersion(ImportCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

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.

Parameters
NameDescription
requestImportCryptoKeyVersionRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKeyVersion>

listCryptoKeyVersions(ListCryptoKeyVersionsRequest request, StreamObserver<ListCryptoKeyVersionsResponse> responseObserver)

public default void listCryptoKeyVersions(ListCryptoKeyVersionsRequest request, StreamObserver<ListCryptoKeyVersionsResponse> responseObserver)

Lists CryptoKeyVersions.

Parameters
NameDescription
requestListCryptoKeyVersionsRequest
responseObserverio.grpc.stub.StreamObserver<ListCryptoKeyVersionsResponse>

listCryptoKeys(ListCryptoKeysRequest request, StreamObserver<ListCryptoKeysResponse> responseObserver)

public default void listCryptoKeys(ListCryptoKeysRequest request, StreamObserver<ListCryptoKeysResponse> responseObserver)

Lists CryptoKeys.

Parameters
NameDescription
requestListCryptoKeysRequest
responseObserverio.grpc.stub.StreamObserver<ListCryptoKeysResponse>

listImportJobs(ListImportJobsRequest request, StreamObserver<ListImportJobsResponse> responseObserver)

public default void listImportJobs(ListImportJobsRequest request, StreamObserver<ListImportJobsResponse> responseObserver)

Lists ImportJobs.

Parameters
NameDescription
requestListImportJobsRequest
responseObserverio.grpc.stub.StreamObserver<ListImportJobsResponse>

listKeyRings(ListKeyRingsRequest request, StreamObserver<ListKeyRingsResponse> responseObserver)

public default void listKeyRings(ListKeyRingsRequest request, StreamObserver<ListKeyRingsResponse> responseObserver)

Lists KeyRings.

Parameters
NameDescription
requestListKeyRingsRequest
responseObserverio.grpc.stub.StreamObserver<ListKeyRingsResponse>

macSign(MacSignRequest request, StreamObserver<MacSignResponse> responseObserver)

public default void macSign(MacSignRequest request, StreamObserver<MacSignResponse> responseObserver)

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

Parameters
NameDescription
requestMacSignRequest
responseObserverio.grpc.stub.StreamObserver<MacSignResponse>

macVerify(MacVerifyRequest request, StreamObserver<MacVerifyResponse> responseObserver)

public default void macVerify(MacVerifyRequest request, StreamObserver<MacVerifyResponse> responseObserver)

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

Parameters
NameDescription
requestMacVerifyRequest
responseObserverio.grpc.stub.StreamObserver<MacVerifyResponse>

rawDecrypt(RawDecryptRequest request, StreamObserver<RawDecryptResponse> responseObserver)

public default void rawDecrypt(RawDecryptRequest request, StreamObserver<RawDecryptResponse> responseObserver)

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

Parameters
NameDescription
requestRawDecryptRequest
responseObserverio.grpc.stub.StreamObserver<RawDecryptResponse>

rawEncrypt(RawEncryptRequest request, StreamObserver<RawEncryptResponse> responseObserver)

public default void rawEncrypt(RawEncryptRequest request, StreamObserver<RawEncryptResponse> responseObserver)

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.

Parameters
NameDescription
requestRawEncryptRequest
responseObserverio.grpc.stub.StreamObserver<RawEncryptResponse>

restoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

public default void restoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

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.

Parameters
NameDescription
requestRestoreCryptoKeyVersionRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKeyVersion>

updateCryptoKey(UpdateCryptoKeyRequest request, StreamObserver<CryptoKey> responseObserver)

public default void updateCryptoKey(UpdateCryptoKeyRequest request, StreamObserver<CryptoKey> responseObserver)

Update a CryptoKey.

Parameters
NameDescription
requestUpdateCryptoKeyRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKey>

updateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request, StreamObserver<CryptoKey> responseObserver)

public default void updateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest request, StreamObserver<CryptoKey> responseObserver)

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.

Parameters
NameDescription
requestUpdateCryptoKeyPrimaryVersionRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKey>

updateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

public default void updateCryptoKeyVersion(UpdateCryptoKeyVersionRequest request, StreamObserver<CryptoKeyVersion> responseObserver)

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.

Parameters
NameDescription
requestUpdateCryptoKeyVersionRequest
responseObserverio.grpc.stub.StreamObserver<CryptoKeyVersion>