public class GrantConstraints extends Object implements Serializable
A structure that you can use to allow certain operations in the grant only when the desired encryption context is present. For more information about encryption context, see Encryption Context in the AWS Key Management Service Developer Guide.
Grant constraints apply only to operations that accept encryption context as
input. For example, the DescribeKey operation does not
accept encryption context as input. A grant that allows the
DescribeKey operation does so regardless of the grant
constraints. In constrast, the Encrypt operation
accepts encryption context as input. A grant that allows the
Encrypt operation does so only when the encryption context of
the Encrypt operation satisfies the grant constraints.
| Constructor and Description |
|---|
GrantConstraints() |
| Modifier and Type | Method and Description |
|---|---|
GrantConstraints |
addEncryptionContextEqualsEntry(String key,
String value)
A list of key-value pairs that must be present in the encryption context
of certain subsequent operations that the grant allows.
|
GrantConstraints |
addEncryptionContextSubsetEntry(String key,
String value)
A list of key-value pairs, all of which must be present in the encryption
context of certain subsequent operations that the grant allows.
|
GrantConstraints |
clearEncryptionContextEqualsEntries()
Removes all the entries added into EncryptionContextEquals.
|
GrantConstraints |
clearEncryptionContextSubsetEntries()
Removes all the entries added into EncryptionContextSubset.
|
boolean |
equals(Object obj) |
Map<String,String> |
getEncryptionContextEquals()
A list of key-value pairs that must be present in the encryption context
of certain subsequent operations that the grant allows.
|
Map<String,String> |
getEncryptionContextSubset()
A list of key-value pairs, all of which must be present in the encryption
context of certain subsequent operations that the grant allows.
|
int |
hashCode() |
void |
setEncryptionContextEquals(Map<String,String> encryptionContextEquals)
A list of key-value pairs that must be present in the encryption context
of certain subsequent operations that the grant allows.
|
void |
setEncryptionContextSubset(Map<String,String> encryptionContextSubset)
A list of key-value pairs, all of which must be present in the encryption
context of certain subsequent operations that the grant allows.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
GrantConstraints |
withEncryptionContextEquals(Map<String,String> encryptionContextEquals)
A list of key-value pairs that must be present in the encryption context
of certain subsequent operations that the grant allows.
|
GrantConstraints |
withEncryptionContextSubset(Map<String,String> encryptionContextSubset)
A list of key-value pairs, all of which must be present in the encryption
context of certain subsequent operations that the grant allows.
|
public Map<String,String> getEncryptionContextSubset()
A list of key-value pairs, all of which must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list or is a superset of this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
A list of key-value pairs, all of which must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list or is a superset of this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
public void setEncryptionContextSubset(Map<String,String> encryptionContextSubset)
A list of key-value pairs, all of which must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list or is a superset of this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
encryptionContextSubset - A list of key-value pairs, all of which must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list or is a superset of this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
public GrantConstraints withEncryptionContextSubset(Map<String,String> encryptionContextSubset)
A list of key-value pairs, all of which must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list or is a superset of this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
Returns a reference to this object so that method calls can be chained together.
encryptionContextSubset - A list of key-value pairs, all of which must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list or is a superset of this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
public GrantConstraints addEncryptionContextSubsetEntry(String key, String value)
A list of key-value pairs, all of which must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list or is a superset of this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
The method adds a new key-value pair into EncryptionContextSubset parameter, and returns a reference to this object so that method calls can be chained together.
key - The key of the entry to be added into EncryptionContextSubset.value - The corresponding value of the entry to be added into
EncryptionContextSubset.public GrantConstraints clearEncryptionContextSubsetEntries()
Returns a reference to this object so that method calls can be chained together.
public Map<String,String> getEncryptionContextEquals()
A list of key-value pairs that must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
A list of key-value pairs that must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
public void setEncryptionContextEquals(Map<String,String> encryptionContextEquals)
A list of key-value pairs that must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
encryptionContextEquals - A list of key-value pairs that must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
public GrantConstraints withEncryptionContextEquals(Map<String,String> encryptionContextEquals)
A list of key-value pairs that must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
Returns a reference to this object so that method calls can be chained together.
encryptionContextEquals - A list of key-value pairs that must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
public GrantConstraints addEncryptionContextEqualsEntry(String key, String value)
A list of key-value pairs that must be present in the encryption context of certain subsequent operations that the grant allows. When certain subsequent operations allowed by the grant include encryption context that matches this list, the grant allows the operation. Otherwise, the grant does not allow the operation.
The method adds a new key-value pair into EncryptionContextEquals parameter, and returns a reference to this object so that method calls can be chained together.
key - The key of the entry to be added into EncryptionContextEquals.value - The corresponding value of the entry to be added into
EncryptionContextEquals.public GrantConstraints clearEncryptionContextEqualsEntries()
Returns a reference to this object so that method calls can be chained together.
public String toString()
toString in class ObjectObject.toString()Copyright © 2018. All rights reserved.