Interface OpenPgpProvider

    • Method Detail

      • getStore

        OpenPgpStore getStore()
        Return the OpenPgpStore instance of this provider. This MUST NOT return null.
        Returns:
        store TODO javadoc me please
      • signAndEncrypt

        OpenPgpElementAndMetadata signAndEncrypt​(SigncryptElement element,
                                                 OpenPgpSelf self,
                                                 java.util.Collection<OpenPgpContact> recipients)
                                          throws java.io.IOException,
                                                 org.bouncycastle.openpgp.PGPException
        Sign a SigncryptElement using our signing key and encrypt it for all recipients and ourselves.
        Parameters:
        element - SigncryptElement which contains a payload which will be transmitted.
        self - our own OpenPGP identity.
        recipients - recipients identities.
        Returns:
        signed and encrypted SigncryptElement as a OpenPgpElement, along with OpenPgpMetadata about the encryption/signatures.
        Throws:
        java.io.IOException - IO is dangerous
        org.bouncycastle.openpgp.PGPException - PGP is brittle
      • sign

        OpenPgpElementAndMetadata sign​(SignElement element,
                                       OpenPgpSelf self)
                                throws java.io.IOException,
                                       org.bouncycastle.openpgp.PGPException
        Sign a SignElement using our signing key.
        Parameters:
        element - SignElement which contains a payload.
        self - our OpenPGP identity.
        Returns:
        signed SignElement as OpenPgpElement, along with OpenPgpMetadata about the signatures.
        Throws:
        java.io.IOException - IO is dangerous
        org.bouncycastle.openpgp.PGPException - PGP is brittle
      • encrypt

        OpenPgpElementAndMetadata encrypt​(CryptElement element,
                                          OpenPgpSelf self,
                                          java.util.Collection<OpenPgpContact> recipients)
                                   throws java.io.IOException,
                                          org.bouncycastle.openpgp.PGPException
        Encrypt a CryptElement for all recipients and ourselves.
        Parameters:
        element - CryptElement which contains a payload which will be transmitted.
        self - our own OpenPGP identity.
        recipients - recipient identities.
        Returns:
        encrypted CryptElement as an OpenPgpElement, along with OpenPgpMetadata about the encryption.
        Throws:
        java.io.IOException - IO is dangerous
        org.bouncycastle.openpgp.PGPException - PGP is brittle
      • decryptAndOrVerify

        OpenPgpMessage decryptAndOrVerify​(org.jivesoftware.smack.XMPPConnection connection,
                                          OpenPgpElement element,
                                          OpenPgpSelf self,
                                          OpenPgpContact sender)
                                   throws java.io.IOException,
                                          org.bouncycastle.openpgp.PGPException
        Decrypt and/or verify signatures on an incoming 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.
        Parameters:
        element - signed and or encrypted OpenPgpElement.
        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:
        java.io.IOException - IO is dangerous
        org.bouncycastle.openpgp.PGPException - PGP is brittle