public interface OpenPgpProvider
Modifier and Type | Method and Description |
---|---|
OpenPgpMessage |
decryptAndOrVerify(OpenPgpElement element,
OpenPgpSelf self,
OpenPgpContact sender)
Decrypt and/or verify signatures on an incoming
OpenPgpElement . |
OpenPgpElementAndMetadata |
encrypt(CryptElement element,
OpenPgpSelf self,
Collection<OpenPgpContact> recipients)
Encrypt a
CryptElement for all recipients and ourselves. |
OpenPgpStore |
getStore()
Return the
OpenPgpStore instance of this provider. |
OpenPgpElementAndMetadata |
sign(SignElement element,
OpenPgpSelf self)
Sign a
SignElement using our signing key. |
OpenPgpElementAndMetadata |
signAndEncrypt(SigncryptElement element,
OpenPgpSelf self,
Collection<OpenPgpContact> recipients)
Sign a
SigncryptElement using our signing key and encrypt it for all recipients and ourselves. |
OpenPgpStore getStore()
OpenPgpStore
instance of this provider.
This MUST NOT return null.OpenPgpElementAndMetadata signAndEncrypt(SigncryptElement element, OpenPgpSelf self, Collection<OpenPgpContact> recipients) throws IOException, org.bouncycastle.openpgp.PGPException
SigncryptElement
using our signing key and encrypt it for all recipients
and ourselves.element
- SigncryptElement
which contains a payload which will be transmitted.self
- our own OpenPGP identity.recipients
- recipients identities.SigncryptElement
as a OpenPgpElement
, along with
OpenPgpMetadata
about the encryption/signatures.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittleOpenPgpElementAndMetadata sign(SignElement element, OpenPgpSelf self) throws IOException, org.bouncycastle.openpgp.PGPException
SignElement
using our signing key.element
- SignElement
which contains a payload.self
- our OpenPGP identity.SignElement
as OpenPgpElement
, along with OpenPgpMetadata
about the
signatures.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittleOpenPgpElementAndMetadata encrypt(CryptElement element, OpenPgpSelf self, Collection<OpenPgpContact> recipients) throws IOException, org.bouncycastle.openpgp.PGPException
CryptElement
for all recipients
and ourselves.element
- CryptElement
which contains a payload which will be transmitted.self
- our own OpenPGP identity.recipients
- recipient identities.CryptElement
as an OpenPgpElement
, along with OpenPgpMetadata
about
the encryption.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittleOpenPgpMessage decryptAndOrVerify(OpenPgpElement element, OpenPgpSelf self, OpenPgpContact sender) throws IOException, org.bouncycastle.openpgp.PGPException
OpenPgpElement
.
If the message is encrypted, this method decrypts it. If it is (also) signed, the signature will be checked.
The resulting OpenPgpMessage
contains the original OpenPgpContentElement
, as well as information
about the encryption/signing.element
- signed and or encrypted OpenPgpElement
.self
- our OpenPGP identity.sender
- OpenPGP identity of the sender.OpenPgpMessage
.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle