public class OpenPgpMessage
extends java.lang.Object
OpenPgpElement.
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.getState(). You should utilize this
information to cast the return value of getOpenPgpContentElement() correctly.
getMetadata() in order to get information about the messages encryption status, its signatures etc.| Modifier and Type | Class and Description |
|---|---|
static class |
OpenPgpMessage.State |
| Constructor and Description |
|---|
OpenPgpMessage(byte[] bytes,
OpenPgpMessage.State state,
org.pgpainless.decryption_verification.OpenPgpMetadata metadata)
Constructor.
|
OpenPgpMessage(java.lang.String content,
OpenPgpMessage.State state,
org.pgpainless.decryption_verification.OpenPgpMetadata metadata)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.pgpainless.decryption_verification.OpenPgpMetadata |
getMetadata()
Return metadata about the encrypted message.
|
OpenPgpContentElement |
getOpenPgpContentElement()
Return the decrypted
OpenPgpContentElement of this message. |
OpenPgpMessage.State |
getState()
Return the state of the message.
|
public OpenPgpMessage(java.lang.String content,
OpenPgpMessage.State state,
org.pgpainless.decryption_verification.OpenPgpMetadata metadata)
content - XML representation of the decrypted OpenPgpContentElement.state - OpenPgpMessage.State of the OpenPgpContentElement.metadata - Metadata about the encryption.public OpenPgpMessage(byte[] bytes,
OpenPgpMessage.State state,
org.pgpainless.decryption_verification.OpenPgpMetadata metadata)
bytes - bytes of the XML representation of the decrypted OpenPgpContentElement.state - OpenPgpMessage.State of the OpenPgpContentElement.metadata - metadata about the encryption.public OpenPgpContentElement getOpenPgpContentElement() throws org.jivesoftware.smack.xml.XmlPullParserException, java.io.IOException
OpenPgpContentElement of this message.
To determine, whether the element is a SignElement, CryptElement or SigncryptElement,
please consult getState().OpenPgpContentElementorg.jivesoftware.smack.xml.XmlPullParserException - if the parser encounters an error.java.io.IOException - if the parser encounters an error.public OpenPgpMessage.State getState() throws java.io.IOException, org.jivesoftware.smack.xml.XmlPullParserException
SignElement,
CryptElement or SigncryptElement.java.io.IOException - if the parser encounters an error.org.jivesoftware.smack.xml.XmlPullParserException - if the parser encounters and error.public org.pgpainless.decryption_verification.OpenPgpMetadata getMetadata()