Package com.amazonaws.services.s3.model
Class EncryptionMaterials
- java.lang.Object
-
- com.amazonaws.services.s3.model.EncryptionMaterials
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
KMSEncryptionMaterials
public class EncryptionMaterials extends Object implements Serializable
The "key encrypting key" materials used in encrypt/decryption. These materials may be either an asymmetric key pair or a symmetric key but not both.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description EncryptionMaterials(KeyPair keyPair)
Constructs a new EncryptionMaterials object, storing an asymmetric key pair.protected
EncryptionMaterials(KeyPair keyPair, SecretKey symmetricKey)
Base constructor for the EncryptionMaterials object.EncryptionMaterials(SecretKey symmetricKey)
Constructs a new EncryptionMaterials object, storing a symmetric key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EncryptionMaterials
addDescription(String name, String value)
Fluent API to add material description.EncryptionMaterials
addDescriptions(Map<String,String> descriptions)
Fluent API to add all the given material descriptions.EncryptionMaterialsAccessor
getAccessor()
Returns null since the EncryptionMaterials base class does not have a materials accessor.String
getCustomerMasterKeyId()
protected String
getDescription(String name)
KeyPair
getKeyPair()
Returns the key pair stored in this EncryptionMaterials object.Map<String,String>
getMaterialsDescription()
Returns a snapshot of the current material description; never null.SecretKey
getSymmetricKey()
Returns the symmetric key stored in this EncryptionMaterials object.boolean
isKMSEnabled()
Returns true if this is a KMS material description; false otherwise.
-
-
-
Constructor Detail
-
EncryptionMaterials
public EncryptionMaterials(KeyPair keyPair)
Constructs a new EncryptionMaterials object, storing an asymmetric key pair.- Parameters:
keyPair
- The asymmetric key pair to be stored in this EncryptionMaterials object.
-
EncryptionMaterials
public EncryptionMaterials(SecretKey symmetricKey)
Constructs a new EncryptionMaterials object, storing a symmetric key.- Parameters:
symmetricKey
- The symmetric key to be stored in this EncryptionMaterials object.
-
EncryptionMaterials
protected EncryptionMaterials(KeyPair keyPair, SecretKey symmetricKey)
Base constructor for the EncryptionMaterials object. This is not publicly visible since it should not be possible to create an EncryptionMaterials object that contains both an asymmetric key pair and a symmetric key.
-
-
Method Detail
-
getKeyPair
public KeyPair getKeyPair()
Returns the key pair stored in this EncryptionMaterials object.- Returns:
- the key pair stored in this EncryptionMaterials object.
-
getSymmetricKey
public SecretKey getSymmetricKey()
Returns the symmetric key stored in this EncryptionMaterials object.- Returns:
- the symmetric key stored in this EncryptionMaterials object.
-
getMaterialsDescription
public Map<String,String> getMaterialsDescription()
Returns a snapshot of the current material description; never null.
-
getAccessor
public EncryptionMaterialsAccessor getAccessor()
Returns null since the EncryptionMaterials base class does not have a materials accessor. Subclasses may override this method.- Returns:
- null
-
addDescription
public EncryptionMaterials addDescription(String name, String value)
Fluent API to add material description.
-
addDescriptions
public EncryptionMaterials addDescriptions(Map<String,String> descriptions)
Fluent API to add all the given material descriptions.
-
isKMSEnabled
public boolean isKMSEnabled()
Returns true if this is a KMS material description; false otherwise.- Returns:
- false by default
-
getCustomerMasterKeyId
public String getCustomerMasterKeyId()
- Throws:
UnsupportedOperationException
- by default
-
-