Class OpenPgpMessage


  • public class OpenPgpMessage
    extends java.lang.Object
    This class embodies a decrypted and/or verified OpenPgpElement.
    The content can be one of the following three OpenPgpContentElements:

    SignElement: The content is expected to be signed with the senders key, but unencrypted.
    CryptElement: The content is expected to be encrypted, but not signed.
    SigncryptElement: The content is expected to be signed with the senders key and encrypted.

    To determine, of which nature the content of the message is, use getState(). You should utilize this information to cast the return value of getOpenPgpContentElement() correctly.
    Use getMetadata() in order to get information about the messages encryption status, its signatures etc.
    • Method Detail

      • getState

        public OpenPgpMessage.State getState()
                                      throws java.io.IOException,
                                             org.jivesoftware.smack.xml.XmlPullParserException
        Return the state of the message. This value determines, whether the message was a SignElement, CryptElement or SigncryptElement.
        Returns:
        state of the content element.
        Throws:
        java.io.IOException - if the parser encounters an error.
        org.jivesoftware.smack.xml.XmlPullParserException - if the parser encounters and error.
      • getMetadata

        public org.pgpainless.decryption_verification.OpenPgpMetadata getMetadata()
        Return metadata about the encrypted message.
        Returns:
        metadata TODO javadoc me please