Interface OpenPgpProvider
- All Known Implementing Classes:
PainlessOpenPgpProvider
public interface OpenPgpProvider
-
Method Summary
Modifier and TypeMethodDescriptiondecryptAndOrVerify(XMPPConnection connection, OpenPgpElement element, OpenPgpSelf self, OpenPgpContact sender) Decrypt and/or verify signatures on an incomingOpenPgpElement.encrypt(CryptElement element, OpenPgpSelf self, Collection<OpenPgpContact> recipients) Encrypt aCryptElementfor allrecipientsand ourselves.getStore()Return theOpenPgpStoreinstance of this provider.sign(SignElement element, OpenPgpSelf self) Sign aSignElementusing our signing key.signAndEncrypt(SigncryptElement element, OpenPgpSelf self, Collection<OpenPgpContact> recipients) Sign aSigncryptElementusing our signing key and encrypt it for allrecipientsand ourselves.
-
Method Details
-
getStore
Return theOpenPgpStoreinstance of this provider. This MUST NOT return null.- Returns:
- store TODO javadoc me please
-
signAndEncrypt
OpenPgpElementAndMetadata signAndEncrypt(SigncryptElement element, OpenPgpSelf self, Collection<OpenPgpContact> recipients) throws IOException, org.bouncycastle.openpgp.PGPException Sign aSigncryptElementusing our signing key and encrypt it for allrecipientsand ourselves.- Parameters:
element-SigncryptElementwhich contains a payload which will be transmitted.self- our own OpenPGP identity.recipients- recipients identities.- Returns:
- signed and encrypted
SigncryptElementas aOpenPgpElement, along withOpenPgpMetadataabout the encryption/signatures. - Throws:
IOException- IO is dangerousorg.bouncycastle.openpgp.PGPException- PGP is brittle
-
sign
OpenPgpElementAndMetadata sign(SignElement element, OpenPgpSelf self) throws IOException, org.bouncycastle.openpgp.PGPException Sign aSignElementusing our signing key.- Parameters:
element-SignElementwhich contains a payload.self- our OpenPGP identity.- Returns:
- signed
SignElementasOpenPgpElement, along withOpenPgpMetadataabout the signatures. - Throws:
IOException- IO is dangerousorg.bouncycastle.openpgp.PGPException- PGP is brittle
-
encrypt
OpenPgpElementAndMetadata encrypt(CryptElement element, OpenPgpSelf self, Collection<OpenPgpContact> recipients) throws IOException, org.bouncycastle.openpgp.PGPException Encrypt aCryptElementfor allrecipientsand ourselves.- Parameters:
element-CryptElementwhich contains a payload which will be transmitted.self- our own OpenPGP identity.recipients- recipient identities.- Returns:
- encrypted
CryptElementas anOpenPgpElement, along withOpenPgpMetadataabout the encryption. - Throws:
IOException- IO is dangerousorg.bouncycastle.openpgp.PGPException- PGP is brittle
-
decryptAndOrVerify
OpenPgpMessage decryptAndOrVerify(XMPPConnection connection, OpenPgpElement element, OpenPgpSelf self, OpenPgpContact sender) throws IOException, org.bouncycastle.openpgp.PGPException Decrypt and/or verify signatures on an incomingOpenPgpElement. If the message is encrypted, this method decrypts it. If it is (also) signed, the signature will be checked. The resultingOpenPgpMessagecontains the originalOpenPgpContentElement, as well as information about the encryption/signing.- Parameters:
element- signed and or encryptedOpenPgpElement.self- our OpenPGP identity.sender- OpenPGP identity of the sender.connection- XMPP connection used to fetch any missing keys.- Returns:
- decrypted message as
OpenPgpMessage. - Throws:
IOException- IO is dangerousorg.bouncycastle.openpgp.PGPException- PGP is brittle
-