public class OpenPgpContact
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected org.jxmpp.jid.BareJid |
jid |
protected OpenPgpStore |
store |
protected java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.lang.Throwable> |
unfetchableKeys |
| Constructor and Description |
|---|
OpenPgpContact(org.jxmpp.jid.BareJid jid,
OpenPgpStore store)
Create a new OpenPgpContact.
|
| Modifier and Type | Method and Description |
|---|---|
void |
distrust(org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Mark a key as
OpenPgpStore.Trust#untrusted. |
org.bouncycastle.openpgp.PGPPublicKeyRingCollection |
getAnnouncedPublicKeys()
Return any announced public keys.
|
org.bouncycastle.openpgp.PGPPublicKeyRingCollection |
getAnyPublicKeys()
Return any available public keys of the user.
|
java.util.Set<org.pgpainless.key.OpenPgpV4Fingerprint> |
getFingerprintsOfKeysWithState(org.bouncycastle.openpgp.PGPPublicKeyRingCollection publicKeys,
OpenPgpTrustStore.Trust trust)
Return a
Set of OpenPgpV4Fingerprints of all keys in publicKeys, which are marked with the
OpenPgpTrustStore.Trust of trust. |
org.jxmpp.jid.BareJid |
getJid()
Return the jid of the contact.
|
protected org.bouncycastle.openpgp.PGPPublicKeyRingCollection |
getPublicKeysOfTrustState(org.bouncycastle.openpgp.PGPPublicKeyRingCollection keys,
OpenPgpTrustStore.Trust trust)
Return a
PGPPublicKeyRingCollection, which contains all keys from keys, which are marked with the
OpenPgpTrustStore.Trust state of trust. |
OpenPgpTrustStore.Trust |
getTrust(org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Determine the
OpenPgpTrustStore.Trust state of the key identified by the fingerprint. |
org.bouncycastle.openpgp.PGPPublicKeyRingCollection |
getTrustedAnnouncedKeys()
Return a
PGPPublicKeyRingCollection which contains all public keys of the contact, which are announced,
as well as marked as OpenPgpStore.Trust#trusted. |
java.util.Set<org.pgpainless.key.OpenPgpV4Fingerprint> |
getTrustedFingerprints()
Return a
Set of OpenPgpV4Fingerprints of all keys of the contact, which have the trust state
OpenPgpStore.Trust#trusted. |
java.util.Set<org.pgpainless.key.OpenPgpV4Fingerprint> |
getUndecidedFingerprints()
Return a
Set of OpenPgpV4Fingerprints of all keys of the contact, which have the trust state
OpenPgpStore.Trust#undecided. |
java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.lang.Throwable> |
getUnfetchableKeys()
Return a
Map of any unfetchable keys fingerprints and the cause of them not being fetched. |
java.util.Set<org.pgpainless.key.OpenPgpV4Fingerprint> |
getUntrustedFingerprints()
Return a
Set of OpenPgpV4Fingerprints of all keys of the contact, which have the trust state
OpenPgpStore.Trust#untrusted. |
boolean |
hasUndecidedKeys()
Determine, whether there are keys available, for which we did not yet decided whether to trust them or not.
|
boolean |
isTrusted(org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Determine, whether the key identified by the
fingerprint is marked as
OpenPgpTrustStore.Trust#trusted or not. |
void |
trust(org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
Mark a key as
OpenPgpStore.Trust#trusted. |
void |
updateKeys(org.jivesoftware.smack.XMPPConnection connection)
Update the contacts keys by consulting the users PubSub nodes.
|
void |
updateKeys(org.jivesoftware.smack.XMPPConnection connection,
PublicKeysListElement metadata)
Update the contacts keys using a prefetched
PublicKeysListElement. |
protected final org.jxmpp.jid.BareJid jid
protected final OpenPgpStore store
protected final java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.lang.Throwable> unfetchableKeys
public OpenPgpContact(org.jxmpp.jid.BareJid jid,
OpenPgpStore store)
jid - BareJid of the contact.store - OpenPgpStore.public org.jxmpp.jid.BareJid getJid()
public org.bouncycastle.openpgp.PGPPublicKeyRingCollection getAnyPublicKeys()
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittlepublic org.bouncycastle.openpgp.PGPPublicKeyRingCollection getAnnouncedPublicKeys()
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
getAnyPublicKeys() with non-announced
keys and keys which lack a user-id with the contacts jid removed.java.io.IOException - IO is dangerousorg.bouncycastle.openpgp.PGPException - PGP is brittleprotected org.bouncycastle.openpgp.PGPPublicKeyRingCollection getPublicKeysOfTrustState(org.bouncycastle.openpgp.PGPPublicKeyRingCollection keys,
OpenPgpTrustStore.Trust trust)
throws java.io.IOException
PGPPublicKeyRingCollection, which contains all keys from keys, which are marked with the
OpenPgpTrustStore.Trust state of trust.keys - PGPPublicKeyRingCollectiontrust - OpenPgpTrustStore.Trustkeys with trust state trust.java.io.IOException - IO errorpublic org.bouncycastle.openpgp.PGPPublicKeyRingCollection getTrustedAnnouncedKeys()
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
PGPPublicKeyRingCollection which contains all public keys of the contact, which are announced,
as well as marked as OpenPgpStore.Trust#trusted.java.io.IOException - IO errororg.bouncycastle.openpgp.PGPException - PGP errorpublic java.util.Set<org.pgpainless.key.OpenPgpV4Fingerprint> getTrustedFingerprints()
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
Set of OpenPgpV4Fingerprints of all keys of the contact, which have the trust state
OpenPgpStore.Trust#trusted.java.io.IOException - IO errororg.bouncycastle.openpgp.PGPException - PGP errorpublic java.util.Set<org.pgpainless.key.OpenPgpV4Fingerprint> getUntrustedFingerprints()
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
Set of OpenPgpV4Fingerprints of all keys of the contact, which have the trust state
OpenPgpStore.Trust#untrusted.java.io.IOException - IO errororg.bouncycastle.openpgp.PGPException - PGP errorpublic java.util.Set<org.pgpainless.key.OpenPgpV4Fingerprint> getUndecidedFingerprints()
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
Set of OpenPgpV4Fingerprints of all keys of the contact, which have the trust state
OpenPgpStore.Trust#undecided.java.io.IOException - IO errororg.bouncycastle.openpgp.PGPException - PGP errorpublic java.util.Set<org.pgpainless.key.OpenPgpV4Fingerprint> getFingerprintsOfKeysWithState(org.bouncycastle.openpgp.PGPPublicKeyRingCollection publicKeys,
OpenPgpTrustStore.Trust trust)
throws java.io.IOException
Set of OpenPgpV4Fingerprints of all keys in publicKeys, which are marked with the
OpenPgpTrustStore.Trust of trust.publicKeys - PGPPublicKeyRingCollection of keys which are iterated.trust - OpenPgpTrustStore.Trust state.Set of fingerprintsjava.io.IOException - IO errorpublic OpenPgpTrustStore.Trust getTrust(org.pgpainless.key.OpenPgpV4Fingerprint fingerprint) throws java.io.IOException
OpenPgpTrustStore.Trust state of the key identified by the fingerprint.fingerprint - OpenPgpV4Fingerprint of the keyjava.io.IOException - IO errorpublic boolean isTrusted(org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
throws java.io.IOException
fingerprint is marked as
OpenPgpTrustStore.Trust#trusted or not.fingerprint - OpenPgpV4Fingerprint of the keyjava.io.IOException - IO errorpublic void trust(org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
throws java.io.IOException
OpenPgpStore.Trust#trusted.fingerprint - OpenPgpV4Fingerprint of the key to mark as trusted.java.io.IOException - IO errorpublic void distrust(org.pgpainless.key.OpenPgpV4Fingerprint fingerprint)
throws java.io.IOException
OpenPgpStore.Trust#untrusted.fingerprint - OpenPgpV4Fingerprint of the key to mark as untrusted.java.io.IOException - IO errorpublic boolean hasUndecidedKeys()
throws java.io.IOException,
org.bouncycastle.openpgp.PGPException
OpenPgpTrustStore.Trust#undecided.java.io.IOException - I/O error reading the keys or trust records.org.bouncycastle.openpgp.PGPException - PGP error reading the keys.public java.util.Map<org.pgpainless.key.OpenPgpV4Fingerprint,java.lang.Throwable> getUnfetchableKeys()
Map of any unfetchable keys fingerprints and the cause of them not being fetched.public void updateKeys(org.jivesoftware.smack.XMPPConnection connection)
throws java.lang.InterruptedException,
org.jivesoftware.smack.SmackException.NotConnectedException,
org.jivesoftware.smack.SmackException.NoResponseException,
org.jivesoftware.smack.XMPPException.XMPPErrorException,
org.jivesoftware.smackx.pubsub.PubSubException.NotALeafNodeException,
org.jivesoftware.smackx.pubsub.PubSubException.NotAPubSubNodeException,
java.io.IOException
connection - our XMPPConnection.java.lang.InterruptedException - In case the thread gets interrupted.SmackException.NotConnectedException - in case the connection is not connected.SmackException.NoResponseException - in case the server doesn't respond.XMPPException.XMPPErrorException - in case of an XMPP protocol error.PubSubException.NotALeafNodeException - in case the metadata node is not a LeafNode.PubSubException.NotAPubSubNodeException - in case the metadata node is not a PubSub node.java.io.IOException - IO is brittle.public void updateKeys(org.jivesoftware.smack.XMPPConnection connection,
PublicKeysListElement metadata)
throws java.lang.InterruptedException,
org.jivesoftware.smack.SmackException.NotConnectedException,
org.jivesoftware.smack.SmackException.NoResponseException,
java.io.IOException
PublicKeysListElement.connection - our XMPPConnection.metadata - pre-fetched OX metadata node of the contact.java.lang.InterruptedException - in case the thread gets interrupted.SmackException.NotConnectedException - in case the connection is not connected.SmackException.NoResponseException - in case the server doesn't respond.java.io.IOException - IO is dangerous.