Search in sources :

Example 1 with RevokeGrantRequest

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

the class RevokeGrant method revokeKeyGrant.

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

Aggregations

KmsException (software.amazon.awssdk.services.kms.model.KmsException)1 RevokeGrantRequest (software.amazon.awssdk.services.kms.model.RevokeGrantRequest)1