public abstract class AbstractOpenPgpKeyStore extends java.lang.Object implements OpenPgpKeyStore
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<org.jxmpp.jid.BareJid,java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date>> |
keyFetchDates |
protected static java.util.logging.Logger |
LOGGER |
protected java.util.Map<org.jxmpp.jid.BareJid,org.bouncycastle.openpgp.PGPPublicKeyRingCollection> |
publicKeyRingCollections |
protected java.util.Map<org.jxmpp.jid.BareJid,org.bouncycastle.openpgp.PGPSecretKeyRingCollection> |
secretKeyRingCollections |
| Constructor and Description |
|---|
AbstractOpenPgpKeyStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
deletePublicKeyRing(org.jxmpp.jid.BareJid owner,
org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Remove a
PGPPublicKeyRing which contains the key described by fingerprint from the
PGPPublicKeyRingCollection of owner. |
void |
deleteSecretKeyRing(org.jxmpp.jid.BareJid owner,
org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Remove a
PGPSecretKeyRing which contains the key described by fingerprint from the
PGPSecretKeyRingCollection of owner. |
org.pgpainless.key.collection.PGPKeyRing |
generateKeyRing(org.jxmpp.jid.BareJid owner)
Generate a new
PGPKeyRing for owner. |
java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> |
getPublicKeyFetchDates(org.jxmpp.jid.BareJid contact)
Return the last date on which keys of
contact were fetched from PubSub. |
org.bouncycastle.openpgp.PGPPublicKeyRing |
getPublicKeyRing(org.jxmpp.jid.BareJid owner,
org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Return the
PGPPublicKeyRing of owner which contains the key described by fingerprint. |
org.bouncycastle.openpgp.PGPPublicKeyRingCollection |
getPublicKeysOf(org.jxmpp.jid.BareJid owner)
Return the
PGPPublicKeyRingCollection containing all public keys of owner that are locally
available. |
org.bouncycastle.openpgp.PGPSecretKeyRing |
getSecretKeyRing(org.jxmpp.jid.BareJid owner,
org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Return the
PGPSecretKeyRing of owner which contains the key described by fingerprint. |
org.bouncycastle.openpgp.PGPSecretKeyRingCollection |
getSecretKeysOf(org.jxmpp.jid.BareJid owner)
Return the
PGPSecretKeyRingCollection containing all secret keys of owner which are locally
available. |
void |
importPublicKey(org.jxmpp.jid.BareJid owner,
org.bouncycastle.openpgp.PGPPublicKeyRing publicKeys)
Import a
PGPPublicKeyRing of owner. |
void |
importSecretKey(org.jxmpp.jid.BareJid owner,
org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)
Import a
PGPSecretKeyRing of owner. |
protected abstract java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> |
readKeyFetchDates(org.jxmpp.jid.BareJid owner)
Read the key fetch dates for a users keys from local storage.
|
protected abstract org.bouncycastle.openpgp.PGPPublicKeyRingCollection |
readPublicKeysOf(org.jxmpp.jid.BareJid owner)
Read a
PGPPublicKeyRingCollection from local storage. |
protected abstract org.bouncycastle.openpgp.PGPSecretKeyRingCollection |
readSecretKeysOf(org.jxmpp.jid.BareJid owner)
Read a
PGPSecretKeyRingCollection from local storage. |
void |
setPublicKeyFetchDates(org.jxmpp.jid.BareJid contact,
java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> dates)
Set the last date on which keys of
contact were fetched from PubSub. |
protected abstract void |
writeKeyFetchDates(org.jxmpp.jid.BareJid owner,
java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> dates)
Write the key fetch dates for a users keys to local storage.
|
protected abstract void |
writePublicKeysOf(org.jxmpp.jid.BareJid owner,
org.bouncycastle.openpgp.PGPPublicKeyRingCollection publicKeys)
Write the
PGPPublicKeyRingCollection of a user to local storage. |
protected abstract void |
writeSecretKeysOf(org.jxmpp.jid.BareJid owner,
org.bouncycastle.openpgp.PGPSecretKeyRingCollection secretKeys)
Write the
PGPSecretKeyRingCollection of a user to local storage. |
protected static final java.util.logging.Logger LOGGER
protected java.util.Map<org.jxmpp.jid.BareJid,org.bouncycastle.openpgp.PGPPublicKeyRingCollection> publicKeyRingCollections
protected java.util.Map<org.jxmpp.jid.BareJid,org.bouncycastle.openpgp.PGPSecretKeyRingCollection> secretKeyRingCollections
protected java.util.Map<org.jxmpp.jid.BareJid,java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date>> keyFetchDates
protected abstract org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPublicKeysOf(org.jxmpp.jid.BareJid owner)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
PGPPublicKeyRingCollection from local storage.
This method returns null, if no keys were found.owner - owner of the keysjava.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittleprotected abstract void writePublicKeysOf(org.jxmpp.jid.BareJid owner,
org.bouncycastle.openpgp.PGPPublicKeyRingCollection publicKeys)
throws java.io.IOException
PGPPublicKeyRingCollection of a user to local storage.owner - owner of the keyspublicKeys - keysjava.io.IOException - IO is dangerousprotected abstract org.bouncycastle.openpgp.PGPSecretKeyRingCollection readSecretKeysOf(org.jxmpp.jid.BareJid owner)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
PGPSecretKeyRingCollection from local storage.
This method returns null, if no keys were found.owner - owner of the keysjava.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittleprotected abstract void writeSecretKeysOf(org.jxmpp.jid.BareJid owner,
org.bouncycastle.openpgp.PGPSecretKeyRingCollection secretKeys)
throws java.io.IOException
PGPSecretKeyRingCollection of a user to local storage.owner - owner of the keyssecretKeys - secret keysjava.io.IOException - IO is dangerousprotected abstract java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> readKeyFetchDates(org.jxmpp.jid.BareJid owner)
throws java.io.IOException
owner - ownerjava.io.IOException - IO is dangerousprotected abstract void writeKeyFetchDates(org.jxmpp.jid.BareJid owner,
java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> dates)
throws java.io.IOException
owner - ownerdates - fetch dates for the owners keysjava.io.IOException - IO is dangerouspublic java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> getPublicKeyFetchDates(org.jxmpp.jid.BareJid contact)
throws java.io.IOException
OpenPgpKeyStorecontact were fetched from PubSub.
This method MUST NOT return null.getPublicKeyFetchDates in interface OpenPgpKeyStorecontact - contact in which we are interested.java.io.IOException - IO is dangerouspublic void setPublicKeyFetchDates(org.jxmpp.jid.BareJid contact,
java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.util.Date> dates)
throws java.io.IOException
OpenPgpKeyStorecontact were fetched from PubSub.setPublicKeyFetchDates in interface OpenPgpKeyStorecontact - contact in which we are interested.dates - dates of last key fetching.java.io.IOException - IO is dangerouspublic org.bouncycastle.openpgp.PGPPublicKeyRingCollection getPublicKeysOf(org.jxmpp.jid.BareJid owner)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
OpenPgpKeyStorePGPPublicKeyRingCollection containing all public keys of owner that are locally
available.
This method might return null.getPublicKeysOf in interface OpenPgpKeyStoreowner - BareJid of the user we want to get keys from.PGPPublicKeyRingCollection of the user.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic org.bouncycastle.openpgp.PGPSecretKeyRingCollection getSecretKeysOf(org.jxmpp.jid.BareJid owner)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
OpenPgpKeyStorePGPSecretKeyRingCollection containing all secret keys of owner which are locally
available.
This method might return null.getSecretKeysOf in interface OpenPgpKeyStoreowner - BareJid of the user we want to get keys from.PGPSecretKeyRingCollection of the user.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic void importSecretKey(org.jxmpp.jid.BareJid owner,
org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException,
MissingUserIdOnKeyException
OpenPgpKeyStorePGPSecretKeyRing of owner.
In case the key ring is already available locally, the keys are skipped.importSecretKey in interface OpenPgpKeyStoreowner - owner of the keyssecretKeys - secret keysjava.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.public void importPublicKey(org.jxmpp.jid.BareJid owner,
org.bouncycastle.openpgp.PGPPublicKeyRing publicKeys)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException,
MissingUserIdOnKeyException
OpenPgpKeyStorePGPPublicKeyRing of owner.
In case the key ring is already available locally, the keys are skipped.importPublicKey in interface OpenPgpKeyStoreowner - owner of the keyspublicKeys - public keysjava.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.public org.bouncycastle.openpgp.PGPPublicKeyRing getPublicKeyRing(org.jxmpp.jid.BareJid owner,
org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
OpenPgpKeyStorePGPPublicKeyRing of owner which contains the key described by fingerprint.
This method might return null.getPublicKeyRing in interface OpenPgpKeyStoreowner - BareJid of the keys ownerfingerprint - OpenPgpV4Fingerprint of a key contained in the key ringPGPPublicKeyRing which contains the key described by fingerprint.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic org.bouncycastle.openpgp.PGPSecretKeyRing getSecretKeyRing(org.jxmpp.jid.BareJid owner,
org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
OpenPgpKeyStorePGPSecretKeyRing of owner which contains the key described by fingerprint.
This method might return null.getSecretKeyRing in interface OpenPgpKeyStoreowner - BareJid of the keys ownerfingerprint - OpenPgpV4Fingerprint of a key contained in the key ringPGPSecretKeyRing which contains the key described by fingerprint.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic void deletePublicKeyRing(org.jxmpp.jid.BareJid owner,
org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
OpenPgpKeyStorePGPPublicKeyRing which contains the key described by fingerprint from the
PGPPublicKeyRingCollection of owner.deletePublicKeyRing in interface OpenPgpKeyStoreowner - owner of the key ringfingerprint - fingerprint of the key whose key ring will be removed.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic void deleteSecretKeyRing(org.jxmpp.jid.BareJid owner,
org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
OpenPgpKeyStorePGPSecretKeyRing which contains the key described by fingerprint from the
PGPSecretKeyRingCollection of owner.deleteSecretKeyRing in interface OpenPgpKeyStoreowner - owner of the key ringfingerprint - fingerprint of the key whose key ring will be removed.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic org.pgpainless.key.collection.PGPKeyRing generateKeyRing(org.jxmpp.jid.BareJid owner)
throws org.bouncycastle.openpgp.PGPException,
java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
java.security.InvalidAlgorithmParameterException
OpenPgpKeyStorePGPKeyRing for owner.
The key will have a user-id containing the users BareJid (eg. "xmpp:juliet@capulet.lit").
This method MUST NOT return null.generateKeyRing in interface OpenPgpKeyStoreowner - owner of the key ring.org.bouncycastle.openpgp.PGPException - PGP is brittlejava.security.NoSuchAlgorithmException - in case there is no Provider registered for the used
OpenPGP algorithms.java.security.NoSuchProviderException - in case there is no suitable Provider registered.java.security.InvalidAlgorithmParameterException - in case an invalid algorithms configuration is used.