use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateImportJobKeyringnameStringImportjob method syncCreateImportJobKeyringnameStringImportjob.
public static void syncCreateImportJobKeyringnameStringImportjob() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
KeyRingName parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]");
String importJobId = "importJobId1449444627";
ImportJob importJob = ImportJob.newBuilder().build();
ImportJob response = keyManagementServiceClient.createImportJob(parent, importJobId, importJob);
}
}
use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateImportJobStringStringImportjob method syncCreateImportJobStringStringImportjob.
public static void syncCreateImportJobStringStringImportjob() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
String parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString();
String importJobId = "importJobId1449444627";
ImportJob importJob = ImportJob.newBuilder().build();
ImportJob response = keyManagementServiceClient.createImportJob(parent, importJobId, importJob);
}
}
use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateKeyRing method syncCreateKeyRing.
public static void syncCreateKeyRing() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
CreateKeyRingRequest request = CreateKeyRingRequest.newBuilder().setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setKeyRingId("keyRingId-2027180374").setKeyRing(KeyRing.newBuilder().build()).build();
KeyRing response = keyManagementServiceClient.createKeyRing(request);
}
}
use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateKeyRingStringStringKeyring method syncCreateKeyRingStringStringKeyring.
public static void syncCreateKeyRingStringStringKeyring() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
String keyRingId = "keyRingId-2027180374";
KeyRing keyRing = KeyRing.newBuilder().build();
KeyRing response = keyManagementServiceClient.createKeyRing(parent, keyRingId, keyRing);
}
}
use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class AsyncDecrypt method asyncDecrypt.
public static void asyncDecrypt() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
DecryptRequest request = DecryptRequest.newBuilder().setName(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).setCiphertext(ByteString.EMPTY).setAdditionalAuthenticatedData(ByteString.EMPTY).setCiphertextCrc32C(Int64Value.newBuilder().build()).setAdditionalAuthenticatedDataCrc32C(Int64Value.newBuilder().build()).build();
ApiFuture<DecryptResponse> future = keyManagementServiceClient.decryptCallable().futureCall(request);
// Do something.
DecryptResponse response = future.get();
}
}
Aggregations