Class PGPEncryptedDataList

java.lang.Object
org.bouncycastle.openpgp.PGPEncryptedDataList
All Implemented Interfaces:
Iterable<PGPEncryptedData>, org.bouncycastle.util.Iterable<PGPEncryptedData>

public class PGPEncryptedDataList extends Object implements org.bouncycastle.util.Iterable<PGPEncryptedData>
A holder for a list of PGP encryption method packets and the encrypted data associated with them.

This holder supports reading a sequence of the following encryption methods, followed by an encrypted data packet:

All of the objects returned from this holder share a reference to the same encrypted data input stream, which can only be consumed once.

  • Constructor Details

  • Method Details

    • isIntegrityProtected

      public boolean isIntegrityProtected()
      Checks whether the packet is integrity protected.
      Returns:
      true if there is a modification detection code package associated with this stream
    • get

      public PGPEncryptedData get(int index)
      Gets the encryption method object at the specified index.
      Parameters:
      index - the encryption method to obtain (0 based).
    • size

      public int size()
      Gets the number of encryption methods in this list.
    • isEmpty

      public boolean isEmpty()
      Returns true iff there are 0 encryption methods in this list.
    • getEncryptedDataObjects

      public Iterator<PGPEncryptedData> getEncryptedDataObjects()
      Returns an iterator over the encryption method objects held in this list, in the order they appeared in the stream they are read from.
    • iterator

      public Iterator<PGPEncryptedData> iterator()
      Support method for Iterable where available.
      Specified by:
      iterator in interface Iterable<PGPEncryptedData>
      Specified by:
      iterator in interface org.bouncycastle.util.Iterable<PGPEncryptedData>
    • extractSessionKeyEncryptedData

      public PGPSessionKeyEncryptedData extractSessionKeyEncryptedData()
      Create a decryption method using a PGPSessionKey. This method can be used to decrypt messages which do not contain a SKESK or PKESK packet using a session key.
      Returns:
      session key encrypted data