Class EncryptionMaterials

java.lang.Object
com.amazonaws.encryptionsdk.model.EncryptionMaterials

public final class EncryptionMaterials extends Object
Contains the cryptographic materials needed for an encryption operation.
See Also:
CryptoMaterialsManager.getMaterialsForEncrypt(EncryptionMaterialsRequest)
  • Method Details

    • toBuilder

      public EncryptionMaterials.Builder toBuilder()
    • newBuilder

      public static EncryptionMaterials.Builder newBuilder()
    • getAlgorithm

      public CryptoAlgorithm getAlgorithm()
      The algorithm to use for this encryption operation. Must match the algorithm in EncryptionMaterialsRequest, if that algorithm was non-null.
    • getEncryptionContext

      public Map<String,​String> getEncryptionContext()
      The encryption context to use for the encryption operation. Does not need to match the EncryptionMaterialsRequest.
    • getEncryptedDataKeys

      public List<KeyBlob> getEncryptedDataKeys()
      The KeyBlobs to serialize (in cleartext) into the encrypted message.
    • getCleartextDataKey

      public SecretKey getCleartextDataKey()
      The cleartext data key to use for encrypting this message. Note that this is the data key prior to any key derivation required by the crypto algorithm in use.
    • getTrailingSignatureKey

      public PrivateKey getTrailingSignatureKey()
      The private key to be used to sign the message trailer. Must be present if any only if required by the crypto algorithm, and the key type must likewise match the algorithm in use.

      Note that it's the CryptoMaterialsManager's responsibility to find a place to put the public key; typically, this will be in the encryption context, to improve cross-compatibility, but this is not a strict requirement.

    • getMasterKeys

      public List<MasterKey> getMasterKeys()
      Contains a list of all MasterKeys that could decrypt this message.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object