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
public class SymmetricEncIntegrityPacket extends InputStreamPacket implements BCPGHeaderObject
A symmetric key encrypted packet with an associated integrity check code.
-
-
Field Summary
Fields Modifier and Type Field Description static int
VERSION_1
Version 1 SEIPD packet.static int
VERSION_2
Version 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 Constructor Description SymmetricEncIntegrityPacket()
Deprecated.use createVersion1Packet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static byte[]
createAAData(int version, int cipherAlgorithm, int aeadAlgorithm, int chunkSize)
static SymmetricEncIntegrityPacket
createVersion1Packet()
static SymmetricEncIntegrityPacket
createVersion2Packet(int algorithm, int aeadAlgorithm, int chunkSize, byte[] salt)
void
encode(BCPGOutputStream bcpgOut)
byte[]
getAAData()
Return the AEAD additional authenticated data, which is also used as HKDF info.int
getAeadAlgorithm()
Return the AEAD algorithm.int
getChunkSize()
Return the chunksize for the AEAD construction.int
getCipherAlgorithm()
Return the cipher algorithm.byte[]
getSalt()
Return the salt used to derive the message key.int
getType()
Return the header type.int
getVersion()
-
Methods inherited from class org.bouncycastle.bcpg.InputStreamPacket
getInputStream
-
Methods inherited from class org.bouncycastle.bcpg.Packet
getPacketTag, hasNewPacketFormat, isCritical
-
-
-
-
Field Detail
-
VERSION_1
public static final int VERSION_1
Version 1 SEIPD packet. Used only withSymmetricKeyEncSessionPacket.VERSION_4
orPublicKeyEncSessionPacket.VERSION_3
.- See Also:
- Constant Field Values
-
VERSION_2
public static final int VERSION_2
Version 2 SEIPD packet. Used only withSymmetricKeyEncSessionPacket.VERSION_6
orPublicKeyEncSessionPacket.VERSION_6
.- See Also:
- Constant Field Values
-
-
Method Detail
-
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 interfaceBCPGHeaderObject
- Returns:
- header type code
-
encode
public void encode(BCPGOutputStream bcpgOut) throws java.io.IOException
- Specified by:
encode
in interfaceBCPGHeaderObject
- Throws:
java.io.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
-
-