public class PainlessOpenPgpProvider extends java.lang.Object implements OpenPgpProvider
| Constructor and Description |
|---|
PainlessOpenPgpProvider(org.jivesoftware.smack.XMPPConnection connection,
OpenPgpStore store) |
| 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,
java.util.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,
java.util.Collection<OpenPgpContact> recipients)
Sign a
SigncryptElement using our signing key and encrypt it for all recipients and ourselves. |
public PainlessOpenPgpProvider(org.jivesoftware.smack.XMPPConnection connection,
OpenPgpStore store)
public OpenPgpStore getStore()
OpenPgpProviderOpenPgpStore instance of this provider.
This MUST NOT return null.getStore in interface OpenPgpProviderpublic OpenPgpElementAndMetadata signAndEncrypt(SigncryptElement element, OpenPgpSelf self, java.util.Collection<OpenPgpContact> recipients) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
OpenPgpProviderSigncryptElement using our signing key and encrypt it for all recipients and ourselves.signAndEncrypt in interface OpenPgpProviderelement - 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.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic OpenPgpElementAndMetadata sign(SignElement element, OpenPgpSelf self) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
OpenPgpProviderSignElement using our signing key.sign in interface OpenPgpProviderelement - SignElement which contains a payload.self - our OpenPGP identity.SignElement as OpenPgpElement, along with OpenPgpMetadata about the
signatures.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic OpenPgpElementAndMetadata encrypt(CryptElement element, OpenPgpSelf self, java.util.Collection<OpenPgpContact> recipients) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
OpenPgpProviderCryptElement for all recipients and ourselves.encrypt in interface OpenPgpProviderelement - 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.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic OpenPgpMessage decryptAndOrVerify(OpenPgpElement element, OpenPgpSelf self, OpenPgpContact sender) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
OpenPgpProviderOpenPgpElement.
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.decryptAndOrVerify in interface OpenPgpProviderelement - signed and or encrypted OpenPgpElement.self - our OpenPGP identity.sender - OpenPGP identity of the sender.OpenPgpMessage.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittle