public final class CloudHsmKeyAttributesMap
extends java.lang.Object
An instance of this class may be used to uniquely configure a key during a key operation. Simply populate an instance using CloudHSM-supported key attributes and values. Then pass the instance as a parameter to the Cavium ParameterSpec class which corresponds to the key operation you wish to execute.
After a key operation concludes, a CaviumKey's attributes and values may be obtained
by calling getCloudHsmKeyAttributesMap() on the key object. An instance of this
class will be returned, containing the key's attributes and values.
IMPORTANT NOTE: Altering the contents of an instance of this class after the conclusion of a key operation will not modify the attributes or values of the key itself.
| Modifier and Type | Class and Description |
|---|---|
static class |
CloudHsmKeyAttributesMap.Builder
A helper class which provides Builder Pattern support for instantiating and populating an
instance of
CloudHsmKeyAttributesMap. |
| Constructor and Description |
|---|
CloudHsmKeyAttributesMap()
Constructs an empty
CloudHsmKeyAttributesMap containing no key attributes or
values. |
CloudHsmKeyAttributesMap(CloudHsmKeyAttributePermissiveProfile permissiveProfile)
Constructs a new
CloudHsmKeyAttributesMap using the key attributes and
permissive values as specified in CloudHsmKeyAttributePermissiveProfile. |
CloudHsmKeyAttributesMap(CloudHsmKeyAttributesMap keyAttributesMap)
Constructs a new
CloudHsmKeyAttributesMap with the same key attributes and
values as the specified CloudHsmKeyAttributesMap. |
| Modifier and Type | Method and Description |
|---|---|
java.security.spec.ECPoint |
calculateEcPoint() |
java.math.BigInteger |
calculateModulus() |
java.math.BigInteger |
calculatePublicExponent() |
boolean |
containsKey(CloudHsmKeyAttributes keyAttribute)
Returns
true if this map contains a mapping for the specified key attribute. |
java.util.Set<java.util.Map.Entry<CloudHsmKeyAttributes,java.lang.Object>> |
entrySet()
Returns a
Set view of the mappings contained in this map. |
java.lang.Object |
get(CloudHsmKeyAttributes keyAttribute)
Returns the value to which the specified key attribute is mapped, or
null if
this map contains no mapping for the key attribute. |
java.lang.String |
getLabel()
A convenience method for getting
CloudHsmKeyAttributes.CKA_LABEL. |
java.lang.Object |
getOrDefault(CloudHsmKeyAttributes keyAttribute,
java.lang.Object defaultValue)
Returns the value to which the specified key attribute is mapped, or
defaultValue
if this map contains no mapping for the key attribute. |
boolean |
isExtractable()
A convenience method for getting
CloudHsmKeyAttributes.CKA_EXTRACTABLE. |
boolean |
isToken()
A convenience method for getting
CloudHsmKeyAttributes.CKA_TOKEN. |
java.util.Set<CloudHsmKeyAttributes> |
keySet()
Returns a
Set view of the key attributes contained in this map. |
java.lang.Object |
put(CloudHsmKeyAttributes keyAttribute,
java.lang.Object value)
Associates the specified value with the specified key attribute in this map.
|
void |
putAll(CloudHsmKeyAttributesMap keyAttributesMap)
Copies all of the mappings from the specified map to this map.
|
java.lang.Object |
remove(CloudHsmKeyAttributes keyAttribute)
Removes the mapping for the specified key attribute from this map if present.
|
boolean |
remove(CloudHsmKeyAttributes keyAttribute,
java.lang.Object value)
Removes the entry for the specified key attribute only if it is currently mapped to the
specified value.
|
void |
setExtractable(boolean value)
A convenience method for setting
CloudHsmKeyAttributes.CKA_EXTRACTABLE. |
void |
setLabel(java.lang.String value)
A convenience method for setting
CloudHsmKeyAttributes.CKA_LABEL. |
void |
setToken(boolean value)
A convenience method for getting
CloudHsmKeyAttributes.CKA_TOKEN. |
java.lang.String |
toString() |
public CloudHsmKeyAttributesMap()
CloudHsmKeyAttributesMap containing no key attributes or
values.public CloudHsmKeyAttributesMap(CloudHsmKeyAttributesMap keyAttributesMap) throws java.lang.NullPointerException
CloudHsmKeyAttributesMap with the same key attributes and
values as the specified CloudHsmKeyAttributesMap.keyAttributesMap - The CloudHsmKeyAttributesMap whose key attributes and
values are to be placed in this CloudHsmKeyAttributesMap.java.lang.NullPointerException - If the specified object is null.public CloudHsmKeyAttributesMap(CloudHsmKeyAttributePermissiveProfile permissiveProfile) throws java.lang.NullPointerException, java.lang.UnsupportedOperationException
CloudHsmKeyAttributesMap using the key attributes and
permissive values as specified in CloudHsmKeyAttributePermissiveProfile.permissiveProfile - A specific CloudHsmKeyAttributePermissiveProfile profile
whose key attributes and permissive values will be used to populate a new instance of
CloudHsmKeyAttributesMap.java.lang.NullPointerException - If the specified profile is null.java.lang.UnsupportedOperationException - If the specified profile is one that cannot be
converted to this map type.public boolean containsKey(CloudHsmKeyAttributes keyAttribute)
true if this map contains a mapping for the specified key attribute.keyAttribute - The key attribute whose presence in this map is to be tested.true if this map contains a mapping for the specified key attribute.public java.util.Set<java.util.Map.Entry<CloudHsmKeyAttributes,java.lang.Object>> entrySet()
Set view of the mappings contained in this map.
The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.
If the map is modified while an iteration over the set is in progress (except through the
iterator's own remove operation, or through the setValue operation
on a map entry returned by the iterator) the results of the iteration are undefined.
Set view of the mappings contained in this map.public java.lang.Object get(CloudHsmKeyAttributes keyAttribute)
null if
this map contains no mapping for the key attribute.keyAttribute - Key attribute whose associated value is to be returned.null if
this map contains no mapping for the key attribute.java.lang.NullPointerException - If the specified key attribute is null.public java.lang.Object getOrDefault(CloudHsmKeyAttributes keyAttribute, java.lang.Object defaultValue) throws java.lang.NullPointerException
defaultValue
if this map contains no mapping for the key attribute.keyAttribute - Key attribute whose associated value is to be returned.defaultValue - The default mapping of the key attribute.defaultValue
if this map contains no mapping for the key attribute.java.lang.NullPointerException - If the specified key attribute is null.public java.util.Set<CloudHsmKeyAttributes> keySet()
Set view of the key attributes contained in this map.
The set is backed by the map, so changes to the map are reflected in the set, and vice-versa.
If the map is modified while an iteration over the set is in progress (except through the
iterator's own remove operation), the results of the iteration are undefined.
Set view of the key attributes contained in this map.public java.lang.Object put(CloudHsmKeyAttributes keyAttribute, java.lang.Object value) throws java.lang.NullPointerException
If the map previously contained a mapping for the key attribute, the old value is replaced.
keyAttribute - Key attribute with which the specified value is to be associated.value - Value to be associated with the specified key attribute.null if there
was no mapping for key attribute.java.lang.NullPointerException - If the specified key attribute or value is null.public void putAll(CloudHsmKeyAttributesMap keyAttributesMap) throws java.lang.NullPointerException
These mappings will replace any mappings that this map had for any of the key attributes currently in the specified map.
keyAttributesMap - Key attribute mappings to be stored in this map.java.lang.NullPointerException - If the specified map is null or it contains
null key attributes or values.public java.lang.Object remove(CloudHsmKeyAttributes keyAttribute) throws java.lang.NullPointerException
keyAttribute - Key attribute whose mapping is to be removed.null if there was no
mapping for keyAttribute.java.lang.NullPointerException - If the specified key attribute is null.public boolean remove(CloudHsmKeyAttributes keyAttribute, java.lang.Object value) throws java.lang.NullPointerException
keyAttribute - Key attribute with which the specified value is associated.value - Value expected to be associated with the specified key attribute.java.lang.NullPointerException - If the specified key attribute or value is null.public java.lang.String getLabel()
CloudHsmKeyAttributes.CKA_LABEL.CloudHsmKeyAttributes.CKA_LABEL; or null
if this map contains no mapping for the key attribute.get(com.amazonaws.cloudhsm.CloudHsmKeyAttributes)public final void setLabel(java.lang.String value)
CloudHsmKeyAttributes.CKA_LABEL.
If the internal map previously contained a mapping for
CloudHsmKeyAttributes.CKA_LABEL, the old value is replaced.
value - The value to store with CloudHsmKeyAttributes.CKA_LABEL; must not be
null.java.security.InvalidParameterException - If the specified value is null.put(com.amazonaws.cloudhsm.CloudHsmKeyAttributes, java.lang.Object)public boolean isExtractable()
CloudHsmKeyAttributes.CKA_EXTRACTABLE.CloudHsmKeyAttributes.CKA_EXTRACTABLE; or
false if this map contains no mapping for the key attribute.get(com.amazonaws.cloudhsm.CloudHsmKeyAttributes)public final void setExtractable(boolean value)
CloudHsmKeyAttributes.CKA_EXTRACTABLE.
If the internal map previously contained a mapping for
CloudHsmKeyAttributes.CKA_EXTRACTABLE, the old value is replaced.
value - The value to store with CloudHsmKeyAttributes.CKA_EXTRACTABLE.put(com.amazonaws.cloudhsm.CloudHsmKeyAttributes, java.lang.Object)public boolean isToken()
CloudHsmKeyAttributes.CKA_TOKEN.
NOTE: This key attribute is often called a different name in CloudHSM JCE
method signatures, persistent.
CloudHsmKeyAttributes.CKA_TOKEN; or
false if this map contains no mapping for the key attribute.get(com.amazonaws.cloudhsm.CloudHsmKeyAttributes)public final void setToken(boolean value)
CloudHsmKeyAttributes.CKA_TOKEN.
If the internal map previously contained a mapping for
CloudHsmKeyAttributes.CKA_TOKEN, the old value is replaced.
NOTE: This key attribute is often called a different name in CloudHSM JCE
method signatures, persistent.
value - The value to store with CloudHsmKeyAttributes.CKA_TOKEN.put(com.amazonaws.cloudhsm.CloudHsmKeyAttributes, java.lang.Object)public java.math.BigInteger calculatePublicExponent()
public java.math.BigInteger calculateModulus()
public java.security.spec.ECPoint calculateEcPoint()
public java.lang.String toString()
toString in class java.lang.Object