Class MessageInspector

java.lang.Object
org.pgpainless.decryption_verification.MessageInspector

public final class MessageInspector extends Object
Inspect an OpenPGP message to determine IDs of its encryption keys or whether it is passphrase protected.
  • Method Details

    • determineEncryptionInfoForMessage

      public static MessageInspector.EncryptionInfo determineEncryptionInfoForMessage(String message) throws org.bouncycastle.openpgp.PGPException, IOException
      Parses parts of the provided OpenPGP message in order to determine which keys were used to encrypt it.
      Parameters:
      message - OpenPGP message
      Returns:
      encryption info
      Throws:
      org.bouncycastle.openpgp.PGPException - in case the message is broken
      IOException - in case of an IO error
    • determineEncryptionInfoForMessage

      public static MessageInspector.EncryptionInfo determineEncryptionInfoForMessage(InputStream dataIn) throws IOException, org.bouncycastle.openpgp.PGPException
      Parses parts of the provided OpenPGP message in order to determine which keys were used to encrypt it. Note: This method does not rewind the passed in Stream, so you might need to take care of that yourselves.
      Parameters:
      dataIn - openpgp message
      Returns:
      encryption information
      Throws:
      IOException - in case of an IO error
      org.bouncycastle.openpgp.PGPException - if the message is broken