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 |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VERSION_1
public static final int VERSION_1
- Version 1 SEIPD packet.
Used only with
SymmetricKeyEncSessionPacket.VERSION_4
or PublicKeyEncSessionPacket.VERSION_3
.
VERSION_2
public static final int VERSION_2
- Version 2 SEIPD packet.
Used only with
SymmetricKeyEncSessionPacket.VERSION_6
or PublicKeyEncSessionPacket.VERSION_6
.
SymmetricEncIntegrityPacket
public SymmetricEncIntegrityPacket()
- Deprecated. use createVersion1Packet()
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
- Following copied from interface:
org.bouncycastle.bcpg.BCPGHeaderObject
- Returns:
- header type code
encode
public void encode(BCPGOutputStream bcpgOut)
throws java.io.IOException
- Specified by:
encode
in interface BCPGHeaderObject
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