public final class CloudHsmKeyPairAttributesMap
extends java.lang.Object
An instance of this class may be used to uniquely configure a key pair 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.
This class essentially encapsulates two CloudHsmKeyAttributesMap objects, one for the
public key and another for the private key.
IMPORTANT NOTE: Altering the contents of an instance of this class after the key has been inserted into the HSM will not modify the attributes or values of the key itself.
CloudHsmKeyAttributes,
CloudHsmKeyAttributesMap| Modifier and Type | Class and Description |
|---|---|
static class |
CloudHsmKeyPairAttributesMap.Builder
A helper class which provides Builder Pattern support for instantiating and populating an
instance of
CloudHsmKeyPairAttributesMap. |
| Constructor and Description |
|---|
CloudHsmKeyPairAttributesMap()
Constructs an empty
CloudHsmKeyPairAttributesMap containing no key pair
attributes or values. |
CloudHsmKeyPairAttributesMap(CloudHsmKeyAttributePermissiveProfile permissiveProfile)
Constructs a new
CloudHsmKeyPairAttributesMap using the key pair attributes and
permissive values as specified in CloudHsmKeyAttributePermissiveProfile. |
CloudHsmKeyPairAttributesMap(CloudHsmKeyAttributesMap publicKeyAttributesMap,
CloudHsmKeyAttributesMap privateKeyAttributesMap)
Constructs a new
CloudHsmKeyPairAttributesMap with the same key attributes and
values as the specified CloudHsmKeyAttributesMap objects, one for the public
key and one for the private key. |
CloudHsmKeyPairAttributesMap(CloudHsmKeyPairAttributesMap keyPairAttributesMap)
Constructs a new
CloudHsmKeyPairAttributesMap with the same key pair attributes
and values as the specified CloudHsmKeyPairAttributesMap. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getOrDefaultPrivate(CloudHsmKeyAttributes keyAttribute,
java.lang.Object defaultValue)
Returns the value to which the specified private key attribute is mapped, or
defaultValue if the private key map contains no mapping for the key attribute. |
java.lang.Object |
getOrDefaultPublic(CloudHsmKeyAttributes keyAttribute,
java.lang.Object defaultValue)
Returns the value to which the specified public key attribute is mapped, or
defaultValue if the public key map contains no mapping for the key attribute. |
CloudHsmKeyAttributesMap |
getPrivate()
Returns the
CloudHsmKeyAttributesMap associated with this key pair's private key. |
java.lang.Object |
getPrivate(CloudHsmKeyAttributes keyAttribute)
Returns the value to which the specified key attribute is mapped, or
null if the
key map contains no mapping for the key attribute. |
CloudHsmKeyAttributesMap |
getPublic()
Returns the
CloudHsmKeyAttributesMap associated with this key pair's public key. |
java.lang.Object |
getPublic(CloudHsmKeyAttributes keyAttribute)
Returns the value to which the specified key attribute is mapped, or
null if the
key map contains no mapping for the key attribute. |
void |
putAll(CloudHsmKeyPairAttributesMap keyPairAttributesMap)
Copies all of the mappings from the specified map to the public and private attributes maps.
|
void |
putAllPrivate(CloudHsmKeyAttributesMap keyAttributesMap)
Copies all of the mappings from the specified map to the private attributes map.
|
void |
putAllPublic(CloudHsmKeyAttributesMap keyAttributesMap)
Copies all of the mappings from the specified map to the public attributes map.
|
java.lang.Object |
putPrivate(CloudHsmKeyAttributes keyAttribute,
java.lang.Object value)
Associates the specified value with the specified key attribute in the private key map.
|
java.lang.Object |
putPublic(CloudHsmKeyAttributes keyAttribute,
java.lang.Object value)
Associates the specified value with the specified key attribute in the public key map.
|
java.lang.String |
toString() |
public CloudHsmKeyPairAttributesMap()
CloudHsmKeyPairAttributesMap containing no key pair
attributes or values.public CloudHsmKeyPairAttributesMap(CloudHsmKeyPairAttributesMap keyPairAttributesMap) throws java.lang.NullPointerException
CloudHsmKeyPairAttributesMap with the same key pair attributes
and values as the specified CloudHsmKeyPairAttributesMap.keyPairAttributesMap - The CloudHsmKeyPairAttributesMap whose key pair
attributes and values are to be placed in this CloudHsmKeyPairAttributesMap.java.lang.NullPointerException - If the specified object is null.public CloudHsmKeyPairAttributesMap(CloudHsmKeyAttributesMap publicKeyAttributesMap, CloudHsmKeyAttributesMap privateKeyAttributesMap) throws java.lang.NullPointerException
CloudHsmKeyPairAttributesMap with the same key attributes and
values as the specified CloudHsmKeyAttributesMap objects, one for the public
key and one for the private key.publicKeyAttributesMap - The CloudHsmKeyAttributesMap whose key attributes
and values are to be placed in this CloudHsmKeyPairAttributesMap's public key
map.privateKeyAttributesMap - The CloudHsmKeyAttributesMap whose key attributes
and values are to be placed in this CloudHsmKeyPairAttributesMap's private key
map.java.lang.NullPointerException - If the specified object is null.public CloudHsmKeyPairAttributesMap(CloudHsmKeyAttributePermissiveProfile permissiveProfile) throws java.lang.NullPointerException, java.lang.UnsupportedOperationException
CloudHsmKeyPairAttributesMap using the key pair attributes and
permissive values as specified in CloudHsmKeyAttributePermissiveProfile.permissiveProfile - A specific CloudHsmKeyAttributePermissiveProfile profile
whose key pair attributes and permissive values will be used to populate a new instance of
CloudHsmKeyPairAttributesMap.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 java.lang.Object getPublic(CloudHsmKeyAttributes keyAttribute) throws java.lang.NullPointerException
null if the
key map contains no mapping for the key attribute.
This will execute against the public key map.
keyAttribute - Public key attribute whose associated value is to be returned.null
if this map contains no mapping for the public key attribute.java.lang.NullPointerException - If the specified public key attribute is null.public java.lang.Object getPrivate(CloudHsmKeyAttributes keyAttribute) throws java.lang.NullPointerException
null if the
key map contains no mapping for the key attribute.
This will execute against the private key map.
keyAttribute - Private key attribute whose associated value is to be returned.null
if this map contains no mapping for the private key attribute.java.lang.NullPointerException - If the specified private key attribute is null.public java.lang.Object getOrDefaultPublic(CloudHsmKeyAttributes keyAttribute, java.lang.Object defaultValue) throws java.lang.NullPointerException
defaultValue if the public key map contains no mapping for the key attribute.keyAttribute - Public key attribute whose associated value is to be returned.defaultValue - The default mapping of the public key attribute.defaultValue if this map contains no mapping for the public key attribute.java.lang.NullPointerException - If the specified public key attribute is null.public java.lang.Object getOrDefaultPrivate(CloudHsmKeyAttributes keyAttribute, java.lang.Object defaultValue) throws java.lang.NullPointerException
defaultValue if the private key map contains no mapping for the key attribute.keyAttribute - Private key attribute whose associated value is to be returned.defaultValue - The default mapping of the private key attribute.defaultValue if this map contains no mapping for the private key attribute.java.lang.NullPointerException - If the specified private key attribute is null.public java.lang.Object putPublic(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 - Public key attribute with which the specified value is to be associated.value - Value to be associated with the specified public key attribute.null if
there was no mapping for the key attribute.java.lang.NullPointerException - If the specified public key attribute or value is
null.public java.lang.Object putPrivate(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 - Private key attribute with which the specified value is to be associated.value - Value to be associated with the specified private key attribute.null if
there was no mapping for the key attribute.java.lang.NullPointerException - If the specified private key attribute or value is
null.public void putAll(CloudHsmKeyPairAttributesMap keyPairAttributesMap) throws java.lang.NullPointerException
These mappings will replace any mappings that this map had for any of the public and private key attributes currently in the specified map.
keyPairAttributesMap - 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 void putAllPublic(CloudHsmKeyAttributesMap keyAttributesMap) throws java.lang.NullPointerException
These mappings will replace any mappings that this map had for any of the public key attributes currently in the specified map.
keyAttributesMap - Public key attribute mappings to be stored in this map.java.lang.NullPointerException - If the specified map is null or it contains null
public key attributes or values.public void putAllPrivate(CloudHsmKeyAttributesMap keyAttributesMap) throws java.lang.NullPointerException
These mappings will replace any mappings that this map had for any of the private key attributes currently in the specified map.
keyAttributesMap - Private key attribute mappings to be stored in this map.java.lang.NullPointerException - If the specified map is null or it contains null
nullprivate key attributes or values.public CloudHsmKeyAttributesMap getPublic()
CloudHsmKeyAttributesMap associated with this key pair's public key.CloudHsmKeyAttributesMap.public CloudHsmKeyAttributesMap getPrivate()
CloudHsmKeyAttributesMap associated with this key pair's private key.CloudHsmKeyAttributesMap.public java.lang.String toString()
toString in class java.lang.Object