use of software.amazon.awssdk.services.kms.model.DisableKeyRequest in project aws-doc-sdk-examples by awsdocs.
the class DisableCustomerKey method disableKey.
// snippet-start:[kms.java2_disable_key.main]
public static void disableKey(KmsClient kmsClient, String keyId) {
try {
DisableKeyRequest keyRequest = DisableKeyRequest.builder().keyId(keyId).build();
kmsClient.disableKey(keyRequest);
} catch (KmsException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Aggregations