Search in sources :

Example 1 with UpdateCryptoKeyVersionRequest

use of com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest in project gapic-generator-java by googleapis.

the class SyncUpdateCryptoKeyVersion method syncUpdateCryptoKeyVersion.

public static void syncUpdateCryptoKeyVersion() throws Exception {
    // It may require modifications to work in your environment.
    try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
        UpdateCryptoKeyVersionRequest request = UpdateCryptoKeyVersionRequest.newBuilder().setCryptoKeyVersion(CryptoKeyVersion.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
        CryptoKeyVersion response = keyManagementServiceClient.updateCryptoKeyVersion(request);
    }
}
Also used : UpdateCryptoKeyVersionRequest(com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest) CryptoKeyVersion(com.google.cloud.kms.v1.CryptoKeyVersion) KeyManagementServiceClient(com.google.cloud.kms.v1.KeyManagementServiceClient)

Example 2 with UpdateCryptoKeyVersionRequest

use of com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest in project gapic-generator-java by googleapis.

the class AsyncUpdateCryptoKeyVersion method asyncUpdateCryptoKeyVersion.

public static void asyncUpdateCryptoKeyVersion() throws Exception {
    // It may require modifications to work in your environment.
    try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
        UpdateCryptoKeyVersionRequest request = UpdateCryptoKeyVersionRequest.newBuilder().setCryptoKeyVersion(CryptoKeyVersion.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();
        ApiFuture<CryptoKeyVersion> future = keyManagementServiceClient.updateCryptoKeyVersionCallable().futureCall(request);
        // Do something.
        CryptoKeyVersion response = future.get();
    }
}
Also used : UpdateCryptoKeyVersionRequest(com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest) CryptoKeyVersion(com.google.cloud.kms.v1.CryptoKeyVersion) KeyManagementServiceClient(com.google.cloud.kms.v1.KeyManagementServiceClient)

Aggregations

CryptoKeyVersion (com.google.cloud.kms.v1.CryptoKeyVersion)2 KeyManagementServiceClient (com.google.cloud.kms.v1.KeyManagementServiceClient)2 UpdateCryptoKeyVersionRequest (com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest)2