Class KeyGrants
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.kms.KeyGrants
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)",
date="2026-02-03T13:58:25.472Z")
@Stability(Stable)
public class KeyGrants
extends software.amazon.jsii.JsiiObject
Collection of grant methods for an IKey.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.kms.*; import software.amazon.awscdk.interfaces.kms.*; IKeyRef keyRef; KeyGrants keyGrants = KeyGrants.fromKey(keyRef, false);
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactions(IGrantable grantee, String... actions) Grant the indicated permissions on this key to the given principal.decrypt(IGrantable grantee) Grant decryption permissions using this key to the given principal.encrypt(IGrantable grantee) Grant encryption permissions using this key to the given principal.encryptDecrypt(IGrantable grantee) Grant encryption and decryption permissions using this key to the given principal.static KeyGrantsCreates grants for an IKeyRef.static KeyGrantsCreates grants for an IKeyRef.generateMac(IGrantable grantee) Grant permissions to generating MACs to the given principal.protected IKeyRefsign(IGrantable grantee) Grant sign permissions using this key to the given principal.signVerify(IGrantable grantee) Grant sign and verify permissions using this key to the given principal.verify(IGrantable grantee) Grant verify permissions using this key to the given principal.verifyMac(IGrantable grantee) Grant permissions to verifying MACs to the given principal.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
KeyGrants
protected KeyGrants(software.amazon.jsii.JsiiObjectRef objRef) -
KeyGrants
protected KeyGrants(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
fromKey
@Stability(Stable) @NotNull public static KeyGrants fromKey(@NotNull IKeyRef resource, @Nullable Boolean trustAccountIdentities) Creates grants for an IKeyRef.- Parameters:
resource- This parameter is required.trustAccountIdentities-
-
fromKey
Creates grants for an IKeyRef.- Parameters:
resource- This parameter is required.
-
actions
@Stability(Stable) @NotNull public Grant actions(@NotNull IGrantable grantee, @NotNull String... actions) Grant the indicated permissions on this key to the given principal.This modifies both the principal's policy as well as the resource policy, since the default CloudFormation setup for KMS keys is that the policy must not be empty and so default grants won't work.
- Parameters:
grantee- This parameter is required.actions- This parameter is required.
-
decrypt
Grant decryption permissions using this key to the given principal.- Parameters:
grantee- This parameter is required.
-
encrypt
Grant encryption permissions using this key to the given principal.- Parameters:
grantee- This parameter is required.
-
encryptDecrypt
Grant encryption and decryption permissions using this key to the given principal.- Parameters:
grantee- This parameter is required.
-
generateMac
Grant permissions to generating MACs to the given principal.- Parameters:
grantee- This parameter is required.
-
sign
Grant sign permissions using this key to the given principal.- Parameters:
grantee- This parameter is required.
-
signVerify
Grant sign and verify permissions using this key to the given principal.- Parameters:
grantee- This parameter is required.
-
verify
Grant verify permissions using this key to the given principal.- Parameters:
grantee- This parameter is required.
-
verifyMac
Grant permissions to verifying MACs to the given principal.- Parameters:
grantee- This parameter is required.
-
getResource
-