Class MessageEncryptionMechanism

java.lang.Object
org.bouncycastle.openpgp.api.MessageEncryptionMechanism

public class MessageEncryptionMechanism extends Object
Encryption mode (SEIPDv1 / SEIPDv2 / OED) and algorithms.
  • Method Details

    • getMode

      public EncryptedDataPacketType getMode()
    • getSymmetricKeyAlgorithm

      public int getSymmetricKeyAlgorithm()
    • getAeadAlgorithm

      public int getAeadAlgorithm()
    • unencrypted

      public static MessageEncryptionMechanism unencrypted()
      The data will not be encrypted. Useful for sign-only operations.
      Returns:
      unencrypted encryption setup
    • integrityProtected

      public static MessageEncryptionMechanism integrityProtected(int symmetricKeyAlgorithm)
      The data will be encrypted and integrity protected using a SEIPDv1 packet.
      Parameters:
      symmetricKeyAlgorithm - symmetric cipher algorithm for message encryption
      Returns:
      sym. enc. integrity protected encryption setup
    • librePgp

      public static MessageEncryptionMechanism librePgp(int symmetricKeyAlgorithm)
      The data will be OCB-encrypted as specified by the non-standard LibrePGP document.
      Parameters:
      symmetricKeyAlgorithm - symmetric key algorithm which will be combined with OCB to form an OCB-encrypted data packet
      Returns:
      LibrePGP OCB encryption setup
    • aead

      public static MessageEncryptionMechanism aead(int symmetricKeyAlgorithm, int aeadAlgorithm)
      The data will be AEAD-encrypted using the method described in RFC9580.
      Parameters:
      symmetricKeyAlgorithm - symmetric cipher algorithm
      aeadAlgorithm - AEAD algorithm
      Returns:
      AEAD encryption setup
    • aead

    • isEncrypted

      public boolean isEncrypted()
      Return true, if the message will be encrypted.
      Returns:
      is encrypted
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object