Class SymmetricEncIntegrityPacket

All Implemented Interfaces:
BCPGHeaderObject, PacketTags

public class SymmetricEncIntegrityPacket extends InputStreamPacket implements BCPGHeaderObject
A symmetric key encrypted packet with an associated integrity check code.
  • Field Details

  • Constructor Details

    • SymmetricEncIntegrityPacket

      public SymmetricEncIntegrityPacket()
      Deprecated.
      use createVersion1Packet()
  • Method Details

    • createVersion1Packet

      public static SymmetricEncIntegrityPacket createVersion1Packet()
    • createVersion2Packet

      public static SymmetricEncIntegrityPacket createVersion2Packet(int algorithm, int aeadAlgorithm, int chunkSize, byte[] salt)
    • getVersion

      public int getVersion()
    • getType

      public int getType()
      Description copied from interface: BCPGHeaderObject
      Return the header type.
      Specified by:
      getType in interface BCPGHeaderObject
      Returns:
      header type code
    • encode

      public void encode(BCPGOutputStream bcpgOut) throws IOException
      Specified by:
      encode in interface BCPGHeaderObject
      Throws:
      IOException
    • getCipherAlgorithm

      public int getCipherAlgorithm()
      Return the cipher algorithm. V2 SEIPD packet only.
      Returns:
      cipher algorithm
    • getAeadAlgorithm

      public int getAeadAlgorithm()
      Return the AEAD algorithm. V2 SEIPD packet only.
      Returns:
      AEAD algorithm
    • getChunkSize

      public int getChunkSize()
      Return the chunksize for the AEAD construction. V2 SEIPD packet only.
      Returns:
      chunksize
    • getAAData

      public byte[] getAAData()
      Return the AEAD additional authenticated data, which is also used as HKDF info. V2 SEIPD packet only.
      Returns:
      aadata
    • createAAData

      public static byte[] createAAData(int version, int cipherAlgorithm, int aeadAlgorithm, int chunkSize)
    • getSalt

      public byte[] getSalt()
      Return the salt used to derive the message key. V2 SEIPD packet only.
      Returns:
      salt