Bouncy Castle Cryptography Library 1.79

org.bouncycastle.bcpg
Class AEADEncDataPacket

java.lang.Object
  |
  +--org.bouncycastle.bcpg.Packet
        |
        +--org.bouncycastle.bcpg.InputStreamPacket
              |
              +--org.bouncycastle.bcpg.AEADEncDataPacket
All Implemented Interfaces:
AEADAlgorithmTags, BCPGHeaderObject, PacketTags

public class AEADEncDataPacket
extends InputStreamPacket
implements AEADAlgorithmTags, BCPGHeaderObject

Packet representing non-standard, LibrePGP OCB (AEAD) encrypted data. At the moment this appears to exist in the following expired draft only, but it's appearing despite this. For standardized, interoperable OpenPGP AEAD encrypted data, see SymmetricEncIntegrityPacket of version SymmetricEncIntegrityPacket.VERSION_2.

See Also:
LibrePGP - OCB Encrypted Data Packet

Field Summary
static int VERSION_1
           
 
Fields inherited from interface org.bouncycastle.bcpg.AEADAlgorithmTags
EAX, GCM, OCB
 
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
AEADEncDataPacket(BCPGInputStream in)
           
AEADEncDataPacket(BCPGInputStream in, boolean newPacketFormat)
           
AEADEncDataPacket(int algorithm, int aeadAlgorithm, int chunkSize, byte[] iv)
           
 
Method Summary
static byte[] createAAData(int version, int symAlgorithm, int aeadAlgorithm, int chunkSize)
           
 void encode(BCPGOutputStream pgOut)
           
 byte[] getAAData()
           
 byte getAEADAlgorithm()
           
 byte getAlgorithm()
          Return the algorithm-id of the symmetric encryption algorithm used to encrypt the data.
 int getChunkSize()
           
 byte[] getIV()
           
static int getIVLength(byte aeadAlgorithm)
          Deprecated. use AEADUtils.getIVLength()
 int getType()
          Return the header type.
 byte getVersion()
           
 
Methods inherited from class org.bouncycastle.bcpg.InputStreamPacket
getInputStream
 
Methods inherited from class org.bouncycastle.bcpg.Packet
getPacketTag, hasNewPacketFormat, isCritical
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_1

public static final int VERSION_1
Constructor Detail

AEADEncDataPacket

public AEADEncDataPacket(BCPGInputStream in)
                  throws java.io.IOException

AEADEncDataPacket

public AEADEncDataPacket(BCPGInputStream in,
                         boolean newPacketFormat)
                  throws java.io.IOException

AEADEncDataPacket

public AEADEncDataPacket(int algorithm,
                         int aeadAlgorithm,
                         int chunkSize,
                         byte[] iv)
Method Detail

getVersion

public byte getVersion()

getAlgorithm

public byte getAlgorithm()
Return the algorithm-id of the symmetric encryption algorithm used to encrypt the data.
Returns:
symmetric encryption algorithm

getAEADAlgorithm

public byte getAEADAlgorithm()

getChunkSize

public int getChunkSize()

getIV

public byte[] getIV()

getAAData

public byte[] getAAData()

createAAData

public static byte[] createAAData(int version,
                                  int symAlgorithm,
                                  int aeadAlgorithm,
                                  int chunkSize)

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 pgOut)
            throws java.io.IOException
Specified by:
encode in interface BCPGHeaderObject

getIVLength

public static int getIVLength(byte aeadAlgorithm)
Deprecated. use AEADUtils.getIVLength()


Bouncy Castle Cryptography Library 1.79