use of com.google.cloud.kms.v1.ImportCryptoKeyVersionRequest 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.ImportCryptoKeyVersionRequest 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