Class PGPPublicKeyEncryptedData

java.lang.Object
org.bouncycastle.openpgp.PGPEncryptedData
org.bouncycastle.openpgp.PGPPublicKeyEncryptedData
All Implemented Interfaces:
SymmetricKeyAlgorithmTags

public class PGPPublicKeyEncryptedData extends PGPEncryptedData
A public key encrypted data object.
  • Method Details

    • getKeyID

      public long getKeyID()
      Return the keyID for the key used to encrypt the data.
      Returns:
      long
    • getSymmetricAlgorithm

      public int getSymmetricAlgorithm(PublicKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException
      Return the symmetric key algorithm required to decrypt the data protected by this object.
      Parameters:
      dataDecryptorFactory - decryptor factory to use to recover the session data.
      Returns:
      the identifier of the encryption algorithm used to encrypt this object.
      Throws:
      PGPException - if the session data cannot be recovered.
    • getSessionKey

      public PGPSessionKey getSessionKey(PublicKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException
      Return the symmetric session key required to decrypt the data protected by this object.
      Parameters:
      dataDecryptorFactory - decryptor factory to use to recover the session data.
      Returns:
      session key used to decrypt the data protected by this object
      Throws:
      PGPException - if the session data cannot be recovered.
    • getDataStream

      public InputStream getDataStream(PublicKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException
      Open an input stream which will provide the decrypted data protected by this object.
      Parameters:
      dataDecryptorFactory - decryptor factory to use to recover the session data and provide the stream.
      Returns:
      the resulting input stream
      Throws:
      PGPException - if the session data cannot be recovered or the stream cannot be created.
    • getDataStream

      public InputStream getDataStream(SessionKeyDataDecryptorFactory dataDecryptorFactory) throws PGPException
      Throws:
      PGPException