Search in sources :

Example 16 with KmsException

use of software.amazon.awssdk.services.kms.model.KmsException in project aws-doc-sdk-examples by awsdocs.

the class EnableCustomerKey method enableKey.

// snippet-start:[kms.java2_enable_key.main]
public static void enableKey(KmsClient kmsClient, String keyId) {
    try {
        EnableKeyRequest enableKeyRequest = EnableKeyRequest.builder().keyId(keyId).build();
        kmsClient.enableKey(enableKeyRequest);
    } catch (KmsException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : EnableKeyRequest(software.amazon.awssdk.services.kms.model.EnableKeyRequest) KmsException(software.amazon.awssdk.services.kms.model.KmsException)

Aggregations

KmsException (software.amazon.awssdk.services.kms.model.KmsException)16 SdkBytes (software.amazon.awssdk.core.SdkBytes)3 KmsClient (software.amazon.awssdk.services.kms.KmsClient)2 DecryptRequest (software.amazon.awssdk.services.kms.model.DecryptRequest)2 DecryptResponse (software.amazon.awssdk.services.kms.model.DecryptResponse)2 EncryptRequest (software.amazon.awssdk.services.kms.model.EncryptRequest)2 EncryptResponse (software.amazon.awssdk.services.kms.model.EncryptResponse)2 AliasListEntry (software.amazon.awssdk.services.kms.model.AliasListEntry)1 CreateAliasRequest (software.amazon.awssdk.services.kms.model.CreateAliasRequest)1 CreateGrantRequest (software.amazon.awssdk.services.kms.model.CreateGrantRequest)1 CreateGrantResponse (software.amazon.awssdk.services.kms.model.CreateGrantResponse)1 CreateKeyRequest (software.amazon.awssdk.services.kms.model.CreateKeyRequest)1 CreateKeyResponse (software.amazon.awssdk.services.kms.model.CreateKeyResponse)1 DeleteAliasRequest (software.amazon.awssdk.services.kms.model.DeleteAliasRequest)1 DescribeKeyRequest (software.amazon.awssdk.services.kms.model.DescribeKeyRequest)1 DescribeKeyResponse (software.amazon.awssdk.services.kms.model.DescribeKeyResponse)1 DisableKeyRequest (software.amazon.awssdk.services.kms.model.DisableKeyRequest)1 EnableKeyRequest (software.amazon.awssdk.services.kms.model.EnableKeyRequest)1 GrantListEntry (software.amazon.awssdk.services.kms.model.GrantListEntry)1 KeyListEntry (software.amazon.awssdk.services.kms.model.KeyListEntry)1