use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateCryptoKeyStringStringCryptokey method syncCreateCryptoKeyStringStringCryptokey.
public static void syncCreateCryptoKeyStringStringCryptokey() 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 cryptoKeyId = "cryptoKeyId-1643185255";
CryptoKey cryptoKey = CryptoKey.newBuilder().build();
CryptoKey response = keyManagementServiceClient.createCryptoKey(parent, cryptoKeyId, cryptoKey);
}
}
use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncCreateCryptoKeyVersionStringCryptokeyversion method syncCreateCryptoKeyVersionStringCryptokeyversion.
public static void syncCreateCryptoKeyVersionStringCryptokeyversion() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
String parent = CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString();
CryptoKeyVersion cryptoKeyVersion = CryptoKeyVersion.newBuilder().build();
CryptoKeyVersion response = keyManagementServiceClient.createCryptoKeyVersion(parent, cryptoKeyVersion);
}
}
use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncGetCryptoKey method syncGetCryptoKey.
public static void syncGetCryptoKey() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
GetCryptoKeyRequest request = GetCryptoKeyRequest.newBuilder().setName(CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString()).build();
CryptoKey response = keyManagementServiceClient.getCryptoKey(request);
}
}
use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncGetCryptoKeyCryptokeyname method syncGetCryptoKeyCryptokeyname.
public static void syncGetCryptoKeyCryptokeyname() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
CryptoKeyName name = CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
CryptoKey response = keyManagementServiceClient.getCryptoKey(name);
}
}
use of com.google.cloud.kms.v1.KeyManagementServiceClient in project gapic-generator-java by googleapis.
the class SyncGetCryptoKeyString method syncGetCryptoKeyString.
public static void syncGetCryptoKeyString() throws Exception {
// It may require modifications to work in your environment.
try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
String name = CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString();
CryptoKey response = keyManagementServiceClient.getCryptoKey(name);
}
}
Aggregations