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
Modifier and TypeFieldDescriptionstatic final int
Version 1 SEIPD packet.static final int
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
createAAData
(int version, int cipherAlgorithm, int aeadAlgorithm, int chunkSize) static SymmetricEncIntegrityPacket
static SymmetricEncIntegrityPacket
createVersion2Packet
(int algorithm, int aeadAlgorithm, int chunkSize, byte[] salt) void
encode
(BCPGOutputStream bcpgOut) byte[]
Return the AEAD additional authenticated data, which is also used as HKDF info.int
Return the AEAD algorithm.int
Return the chunksize for the AEAD construction.int
Return the cipher algorithm.byte[]
getSalt()
Return the salt used to derive the message key.int
getType()
Return the header type.int
Methods inherited from class org.bouncycastle.bcpg.InputStreamPacket
getInputStream
Methods inherited from class org.bouncycastle.bcpg.Packet
getPacketTag, hasNewPacketFormat, isCritical
-
Field Details
-
VERSION_1
public static final int VERSION_1Version 1 SEIPD packet. Used only withSymmetricKeyEncSessionPacket.VERSION_4
orPublicKeyEncSessionPacket.VERSION_3
.- See Also:
-
VERSION_2
public static final int VERSION_2Version 2 SEIPD packet. Used only withSymmetricKeyEncSessionPacket.VERSION_6
orPublicKeyEncSessionPacket.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:BCPGHeaderObject
Return the header type.- Specified by:
getType
in interfaceBCPGHeaderObject
- Returns:
- header type code
-
encode
- Specified by:
encode
in 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
-