public class OpenPgpMessage extends Object
OpenPgpElement
.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(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(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.xmlpull.v1.XmlPullParserException, IOException
OpenPgpContentElement
of this message.
To determine, whether the element is a SignElement
, CryptElement
or SigncryptElement
,
please consult getState()
.OpenPgpContentElement
org.xmlpull.v1.XmlPullParserException
- if the parser encounters an error.IOException
- if the parser encounters an error.public OpenPgpMessage.State getState() throws IOException, org.xmlpull.v1.XmlPullParserException
SignElement
,
CryptElement
or SigncryptElement
.IOException
- if the parser encounters an error.org.xmlpull.v1.XmlPullParserException
- if the parser encounters and error.public org.pgpainless.decryption_verification.OpenPgpMetadata getMetadata()