Package org.bouncycastle.bcpg
Class SymmetricEncIntegrityPacket
java.lang.Object
org.bouncycastle.bcpg.Packet
org.bouncycastle.bcpg.InputStreamPacket
org.bouncycastle.bcpg.SymmetricEncIntegrityPacket
- All Implemented Interfaces:
BCPGHeaderObject,PacketTags
A symmetric key encrypted packet with an associated integrity check code.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intVersion 1 SEIPD packet.static final intVersion 2 SEIPD packet.Fields inherited from interface org.bouncycastle.bcpg.PacketTags
AEAD_ENC_DATA, COMPRESSED_DATA, EXPERIMENTAL_1, EXPERIMENTAL_2, EXPERIMENTAL_3, EXPERIMENTAL_4, LITERAL_DATA, MARKER, MOD_DETECTION_CODE, ONE_PASS_SIGNATURE, PADDING, PUBLIC_KEY, PUBLIC_KEY_ENC_SESSION, PUBLIC_SUBKEY, RESERVED, SECRET_KEY, SECRET_SUBKEY, SIGNATURE, SYM_ENC_INTEGRITY_PRO, SYMMETRIC_KEY_ENC, SYMMETRIC_KEY_ENC_SESSION, TRUST, USER_ATTRIBUTE, USER_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]createAAData(int version, int cipherAlgorithm, int aeadAlgorithm, int chunkSize) static SymmetricEncIntegrityPacketstatic SymmetricEncIntegrityPacketcreateVersion2Packet(int algorithm, int aeadAlgorithm, int chunkSize, byte[] salt) voidencode(BCPGOutputStream bcpgOut) byte[]Return the AEAD additional authenticated data, which is also used as HKDF info.intReturn the AEAD algorithm.intReturn the chunksize for the AEAD construction.intReturn the cipher algorithm.byte[]getSalt()Return the salt used to derive the message key.intgetType()Return the header type.intMethods inherited from class org.bouncycastle.bcpg.InputStreamPacket
getInputStreamMethods inherited from class org.bouncycastle.bcpg.Packet
getPacketTag, isCritical
-
Field Details
-
VERSION_1
public static final int VERSION_1Version 1 SEIPD packet. Used only withSymmetricKeyEncSessionPacket.VERSION_4orPublicKeyEncSessionPacket.VERSION_3.- See Also:
-
VERSION_2
public static final int VERSION_2Version 2 SEIPD packet. Used only withSymmetricKeyEncSessionPacket.VERSION_6orPublicKeyEncSessionPacket.VERSION_6.- See Also:
-
-
Constructor Details
-
SymmetricEncIntegrityPacket
public SymmetricEncIntegrityPacket()Deprecated.use createVersion1Packet()
-
-
Method Details
-
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:BCPGHeaderObjectReturn the header type.- Specified by:
getTypein interfaceBCPGHeaderObject- Returns:
- header type code
-
encode
- Specified by:
encodein interfaceBCPGHeaderObject- 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
-