Interface OpenPgpKeyStore

All Known Subinterfaces:
OpenPgpStore
All Known Implementing Classes:
AbstractOpenPgpKeyStore, AbstractOpenPgpStore, FileBasedOpenPgpKeyStore, FileBasedOpenPgpStore

public interface OpenPgpKeyStore
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deletePublicKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
    Remove a PGPPublicKeyRing which contains the key described by fingerprint from the PGPPublicKeyRingCollection of owner.
    void
    deleteSecretKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
    Remove a PGPSecretKeyRing which contains the key described by fingerprint from the PGPSecretKeyRingCollection of owner.
    org.bouncycastle.openpgp.PGPSecretKeyRing
    Generate a new PGPSecretKeyRing for owner.
    Map<org.pgpainless.key.OpenPgpV4Fingerprint,Date>
    Return the last date on which keys of contact were fetched from PubSub.
    org.bouncycastle.openpgp.PGPPublicKeyRing
    getPublicKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
    Return the PGPPublicKeyRing of owner which contains the key described by fingerprint.
    org.bouncycastle.openpgp.PGPPublicKeyRingCollection
    Return the PGPPublicKeyRingCollection containing all public keys of owner that are locally available.
    org.bouncycastle.openpgp.PGPSecretKeyRing
    getSecretKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
    Return the PGPSecretKeyRing of owner which contains the key described by fingerprint.
    org.bouncycastle.openpgp.PGPSecretKeyRingCollection
    Return the PGPSecretKeyRingCollection containing all secret keys of owner which are locally available.
    void
    importPublicKey(BareJid owner, org.bouncycastle.openpgp.PGPPublicKeyRing publicKeys)
    Import a PGPPublicKeyRing of owner.
    void
    importSecretKey(BareJid owner, org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)
    Import a PGPSecretKeyRing of owner.
    void
    setPublicKeyFetchDates(BareJid contact, Map<org.pgpainless.key.OpenPgpV4Fingerprint,Date> dates)
    Set the last date on which keys of contact were fetched from PubSub.
  • Method Details

    • getPublicKeysOf

      org.bouncycastle.openpgp.PGPPublicKeyRingCollection getPublicKeysOf(BareJid owner) throws IOException, org.bouncycastle.openpgp.PGPException
      Return the PGPPublicKeyRingCollection containing all public keys of owner that are locally available. This method might return null.
      Parameters:
      owner - BareJid of the user we want to get keys from.
      Returns:
      PGPPublicKeyRingCollection of the user.
      Throws:
      IOException - IO is dangerous
      org.bouncycastle.openpgp.PGPException - PGP is brittle
    • getSecretKeysOf

      org.bouncycastle.openpgp.PGPSecretKeyRingCollection getSecretKeysOf(BareJid owner) throws IOException, org.bouncycastle.openpgp.PGPException
      Return the PGPSecretKeyRingCollection containing all secret keys of owner which are locally available. This method might return null.
      Parameters:
      owner - BareJid of the user we want to get keys from.
      Returns:
      PGPSecretKeyRingCollection of the user.
      Throws:
      IOException - IO is dangerous
      org.bouncycastle.openpgp.PGPException - PGP is brittle
    • getPublicKeyRing

      org.bouncycastle.openpgp.PGPPublicKeyRing getPublicKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws IOException, org.bouncycastle.openpgp.PGPException
      Return the PGPPublicKeyRing of owner which contains the key described by fingerprint. This method might return null.
      Parameters:
      owner - BareJid of the keys owner
      fingerprint - OpenPgpV4Fingerprint of a key contained in the key ring
      Returns:
      PGPPublicKeyRing which contains the key described by fingerprint.
      Throws:
      IOException - IO is dangerous
      org.bouncycastle.openpgp.PGPException - PGP is brittle
    • getSecretKeyRing

      org.bouncycastle.openpgp.PGPSecretKeyRing getSecretKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws IOException, org.bouncycastle.openpgp.PGPException
      Return the PGPSecretKeyRing of owner which contains the key described by fingerprint. This method might return null.
      Parameters:
      owner - BareJid of the keys owner
      fingerprint - OpenPgpV4Fingerprint of a key contained in the key ring
      Returns:
      PGPSecretKeyRing which contains the key described by fingerprint.
      Throws:
      IOException - IO is dangerous
      org.bouncycastle.openpgp.PGPException - PGP is brittle
    • deletePublicKeyRing

      void deletePublicKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws IOException, org.bouncycastle.openpgp.PGPException
      Remove a PGPPublicKeyRing which contains the key described by fingerprint from the PGPPublicKeyRingCollection of owner.
      Parameters:
      owner - owner of the key ring
      fingerprint - fingerprint of the key whose key ring will be removed.
      Throws:
      IOException - IO is dangerous
      org.bouncycastle.openpgp.PGPException - PGP is brittle
    • deleteSecretKeyRing

      void deleteSecretKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws IOException, org.bouncycastle.openpgp.PGPException
      Remove a PGPSecretKeyRing which contains the key described by fingerprint from the PGPSecretKeyRingCollection of owner.
      Parameters:
      owner - owner of the key ring
      fingerprint - fingerprint of the key whose key ring will be removed.
      Throws:
      IOException - IO is dangerous
      org.bouncycastle.openpgp.PGPException - PGP is brittle
    • generateKeyRing

      org.bouncycastle.openpgp.PGPSecretKeyRing generateKeyRing(BareJid owner) throws org.bouncycastle.openpgp.PGPException, NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException
      Generate a new PGPSecretKeyRing for owner. The key will have a user-id containing the users BareJid (eg. "xmpp:juliet@capulet.lit"). This method MUST NOT return null.
      Parameters:
      owner - owner of the key ring.
      Returns:
      key ring
      Throws:
      org.bouncycastle.openpgp.PGPException - PGP is brittle
      NoSuchAlgorithmException - in case there is no Provider registered for the used OpenPGP algorithms.
      NoSuchProviderException - in case there is no suitable Provider registered.
      InvalidAlgorithmParameterException - in case an invalid algorithms configuration is used.
    • importSecretKey

      void importSecretKey(BareJid owner, org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys) throws IOException, org.bouncycastle.openpgp.PGPException, MissingUserIdOnKeyException
      Import a PGPSecretKeyRing of owner. In case the key ring is already available locally, the keys are skipped.
      Parameters:
      owner - owner of the keys
      secretKeys - secret keys
      Throws:
      IOException - IO is dangerous
      org.bouncycastle.openpgp.PGPException - PGP is brittle
      MissingUserIdOnKeyException - in case the secret keys are lacking a user-id with the owners jid.
    • importPublicKey

      void importPublicKey(BareJid owner, org.bouncycastle.openpgp.PGPPublicKeyRing publicKeys) throws IOException, org.bouncycastle.openpgp.PGPException, MissingUserIdOnKeyException
      Import a PGPPublicKeyRing of owner. In case the key ring is already available locally, the keys are skipped.
      Parameters:
      owner - owner of the keys
      publicKeys - public keys
      Throws:
      IOException - IO is dangerous
      org.bouncycastle.openpgp.PGPException - PGP is brittle
      MissingUserIdOnKeyException - in case the public keys are lacking a user-id with the owners jid.
    • getPublicKeyFetchDates

      Map<org.pgpainless.key.OpenPgpV4Fingerprint,Date> getPublicKeyFetchDates(BareJid contact) throws IOException
      Return the last date on which keys of contact were fetched from PubSub. This method MUST NOT return null.
      Parameters:
      contact - contact in which we are interested.
      Returns:
      dates of last key fetching.
      Throws:
      IOException - IO is dangerous
    • setPublicKeyFetchDates

      void setPublicKeyFetchDates(BareJid contact, Map<org.pgpainless.key.OpenPgpV4Fingerprint,Date> dates) throws IOException
      Set the last date on which keys of contact were fetched from PubSub.
      Parameters:
      contact - contact in which we are interested.
      dates - dates of last key fetching.
      Throws:
      IOException - IO is dangerous