use of com.google.cloud.kms.v1.CryptoKeyVersion in project gapic-generator-java by googleapis.
the class SyncDestroyCryptoKeyVersion method syncDestroyCryptoKeyVersion.
public static void syncDestroyCryptoKeyVersion() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
DestroyCryptoKeyVersionRequest request = DestroyCryptoKeyVersionRequest.newBuilder().setName(CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]").toString()).build();
CryptoKeyVersion response = keyManagementServiceClient.destroyCryptoKeyVersion(request);
}
}
use of com.google.cloud.kms.v1.CryptoKeyVersion in project gapic-generator-java by googleapis.
the class SyncDestroyCryptoKeyVersionCryptokeyversionname method syncDestroyCryptoKeyVersionCryptokeyversionname.
public static void syncDestroyCryptoKeyVersionCryptokeyversionname() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
CryptoKeyVersion response = keyManagementServiceClient.destroyCryptoKeyVersion(name);
}
}
use of com.google.cloud.kms.v1.CryptoKeyVersion in project gapic-generator-java by googleapis.
the class SyncDestroyCryptoKeyVersionString method syncDestroyCryptoKeyVersionString.
public static void syncDestroyCryptoKeyVersionString() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
String name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]").toString();
CryptoKeyVersion response = keyManagementServiceClient.destroyCryptoKeyVersion(name);
}
}
use of com.google.cloud.kms.v1.CryptoKeyVersion in project gapic-generator-java by googleapis.
the class AsyncImportCryptoKeyVersion method asyncImportCryptoKeyVersion.
public static void asyncImportCryptoKeyVersion() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
ImportCryptoKeyVersionRequest request = ImportCryptoKeyVersionRequest.newBuilder().setParent(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setImportJob("importJob-208547368").build();
ApiFuture<CryptoKeyVersion> future = keyManagementServiceClient.importCryptoKeyVersionCallable().futureCall(request);
// Do something.
CryptoKeyVersion response = future.get();
}
}
use of com.google.cloud.kms.v1.CryptoKeyVersion in project gapic-generator-java by googleapis.
the class SyncImportCryptoKeyVersion method syncImportCryptoKeyVersion.
public static void syncImportCryptoKeyVersion() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
ImportCryptoKeyVersionRequest request = ImportCryptoKeyVersionRequest.newBuilder().setParent(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setImportJob("importJob-208547368").build();
CryptoKeyVersion response = keyManagementServiceClient.importCryptoKeyVersion(request);
}
}
Aggregations