Interface OpenPgpKeyStore
-
- All Known Subinterfaces:
OpenPgpStore
- All Known Implementing Classes:
AbstractOpenPgpKeyStore
,AbstractOpenPgpStore
,FileBasedOpenPgpKeyStore
,FileBasedOpenPgpStore
public interface OpenPgpKeyStore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deletePublicKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Remove aPGPPublicKeyRing
which contains the key described byfingerprint
from thePGPPublicKeyRingCollection
ofowner
.void
deleteSecretKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Remove aPGPSecretKeyRing
which contains the key described byfingerprint
from thePGPSecretKeyRingCollection
ofowner
.org.pgpainless.key.collection.PGPKeyRing
generateKeyRing(BareJid owner)
Generate a newPGPKeyRing
forowner
.java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date>
getPublicKeyFetchDates(BareJid contact)
Return the last date on which keys ofcontact
were fetched from PubSub.org.bouncycastle.openpgp.PGPPublicKeyRing
getPublicKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Return thePGPPublicKeyRing
ofowner
which contains the key described byfingerprint
.org.bouncycastle.openpgp.PGPPublicKeyRingCollection
getPublicKeysOf(BareJid owner)
Return thePGPPublicKeyRingCollection
containing all public keys ofowner
that are locally available.org.bouncycastle.openpgp.PGPSecretKeyRing
getSecretKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Return thePGPSecretKeyRing
ofowner
which contains the key described byfingerprint
.org.bouncycastle.openpgp.PGPSecretKeyRingCollection
getSecretKeysOf(BareJid owner)
Return thePGPSecretKeyRingCollection
containing all secret keys ofowner
which are locally available.void
importPublicKey(BareJid owner, org.bouncycastle.openpgp.PGPPublicKeyRing publicKeys)
Import aPGPPublicKeyRing
ofowner
.void
importSecretKey(BareJid owner, org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)
Import aPGPSecretKeyRing
ofowner
.void
setPublicKeyFetchDates(BareJid contact, java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> dates)
Set the last date on which keys ofcontact
were fetched from PubSub.
-
-
-
Method Detail
-
getPublicKeysOf
org.bouncycastle.openpgp.PGPPublicKeyRingCollection getPublicKeysOf(BareJid owner) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
Return thePGPPublicKeyRingCollection
containing all public keys ofowner
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:
java.io.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
getSecretKeysOf
org.bouncycastle.openpgp.PGPSecretKeyRingCollection getSecretKeysOf(BareJid owner) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
Return thePGPSecretKeyRingCollection
containing all secret keys ofowner
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:
java.io.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
getPublicKeyRing
org.bouncycastle.openpgp.PGPPublicKeyRing getPublicKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
Return thePGPPublicKeyRing
ofowner
which contains the key described byfingerprint
. This method might return null.- Parameters:
owner
-BareJid
of the keys ownerfingerprint
-OpenPgpV4Fingerprint
of a key contained in the key ring- Returns:
PGPPublicKeyRing
which contains the key described byfingerprint
.- Throws:
java.io.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
getSecretKeyRing
org.bouncycastle.openpgp.PGPSecretKeyRing getSecretKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
Return thePGPSecretKeyRing
ofowner
which contains the key described byfingerprint
. This method might return null.- Parameters:
owner
-BareJid
of the keys ownerfingerprint
-OpenPgpV4Fingerprint
of a key contained in the key ring- Returns:
PGPSecretKeyRing
which contains the key described byfingerprint
.- Throws:
java.io.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
deletePublicKeyRing
void deletePublicKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
Remove aPGPPublicKeyRing
which contains the key described byfingerprint
from thePGPPublicKeyRingCollection
ofowner
.- Parameters:
owner
- owner of the key ringfingerprint
- fingerprint of the key whose key ring will be removed.- Throws:
java.io.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
deleteSecretKeyRing
void deleteSecretKeyRing(BareJid owner, org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws java.io.IOException, org.bouncycastle.openpgp.PGPException
Remove aPGPSecretKeyRing
which contains the key described byfingerprint
from thePGPSecretKeyRingCollection
ofowner
.- Parameters:
owner
- owner of the key ringfingerprint
- fingerprint of the key whose key ring will be removed.- Throws:
java.io.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
generateKeyRing
org.pgpainless.key.collection.PGPKeyRing generateKeyRing(BareJid owner) throws org.bouncycastle.openpgp.PGPException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidAlgorithmParameterException
Generate a newPGPKeyRing
forowner
. The key will have a user-id containing the usersBareJid
(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 brittlejava.security.NoSuchAlgorithmException
- in case there is noProvider
registered for the used OpenPGP algorithms.java.security.NoSuchProviderException
- in case there is no suitableProvider
registered.java.security.InvalidAlgorithmParameterException
- in case an invalid algorithms configuration is used.
-
importSecretKey
void importSecretKey(BareJid owner, org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys) throws java.io.IOException, org.bouncycastle.openpgp.PGPException, MissingUserIdOnKeyException
Import aPGPSecretKeyRing
ofowner
. In case the key ring is already available locally, the keys are skipped.- Parameters:
owner
- owner of the keyssecretKeys
- secret keys- Throws:
java.io.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittleMissingUserIdOnKeyException
- 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 java.io.IOException, org.bouncycastle.openpgp.PGPException, MissingUserIdOnKeyException
Import aPGPPublicKeyRing
ofowner
. In case the key ring is already available locally, the keys are skipped.- Parameters:
owner
- owner of the keyspublicKeys
- public keys- Throws:
java.io.IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittleMissingUserIdOnKeyException
- in case the public keys are lacking a user-id with the owners jid.
-
getPublicKeyFetchDates
java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> getPublicKeyFetchDates(BareJid contact) throws java.io.IOException
Return the last date on which keys ofcontact
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:
java.io.IOException
- IO is dangerous
-
setPublicKeyFetchDates
void setPublicKeyFetchDates(BareJid contact, java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> dates) throws java.io.IOException
Set the last date on which keys ofcontact
were fetched from PubSub.- Parameters:
contact
- contact in which we are interested.dates
- dates of last key fetching.- Throws:
java.io.IOException
- IO is dangerous
-
-