Package org.jivesoftware.smackx.ox
Class OpenPgpSelf
- java.lang.Object
-
- org.jivesoftware.smackx.ox.OpenPgpContact
-
- org.jivesoftware.smackx.ox.OpenPgpSelf
-
public class OpenPgpSelf extends OpenPgpContact
This class acts as our own OpenPGP identity. It can be seen as a special view on theOpenPgpStore
, giving access to our own encryption keys etc.
-
-
Field Summary
-
Fields inherited from class org.jivesoftware.smackx.ox.OpenPgpContact
jid, store, unfetchableKeys
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.openpgp.PGPPublicKeyRingCollection
getAnnouncedPublicKeys()
Return aPGPPublicKeyRingCollection
containing only the public keys belonging to our signing key ring.org.bouncycastle.openpgp.PGPSecretKeyRingCollection
getSecretKeys()
Return aPGPSecretKeyRingCollection
which contains all of ourPGPSecretKeyRing
s.org.pgpainless.key.OpenPgpV4Fingerprint
getSigningKeyFingerprint()
Return theOpenPgpV4Fingerprint
of our signing key.org.bouncycastle.openpgp.PGPSecretKeyRing
getSigningKeyRing()
Return thePGPSecretKeyRing
which we will use to sign our messages.boolean
hasSecretKeyAvailable()
Return true, if we have a usable secret key available.-
Methods inherited from class org.jivesoftware.smackx.ox.OpenPgpContact
distrust, getAnyPublicKeys, getFingerprintsOfKeysWithState, getJid, getPublicKeysOfTrustState, getTrust, getTrustedAnnouncedKeys, getTrustedFingerprints, getUndecidedFingerprints, getUnfetchableKeys, getUntrustedFingerprints, hasUndecidedKeys, isTrusted, trust, updateKeys, updateKeys
-
-
-
-
Method Detail
-
hasSecretKeyAvailable
public boolean hasSecretKeyAvailable() throws IOException, org.bouncycastle.openpgp.PGPException
Return true, if we have a usable secret key available.- Returns:
- true if we have secret key, otherwise false.
- Throws:
IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
getSecretKeys
public org.bouncycastle.openpgp.PGPSecretKeyRingCollection getSecretKeys() throws IOException, org.bouncycastle.openpgp.PGPException
Return aPGPSecretKeyRingCollection
which contains all of ourPGPSecretKeyRing
s.- Returns:
- collection of our secret keys
- Throws:
IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
getSigningKeyRing
public org.bouncycastle.openpgp.PGPSecretKeyRing getSigningKeyRing() throws IOException, org.bouncycastle.openpgp.PGPException
Return thePGPSecretKeyRing
which we will use to sign our messages.- Returns:
- signing key
- Throws:
IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
getSigningKeyFingerprint
public org.pgpainless.key.OpenPgpV4Fingerprint getSigningKeyFingerprint() throws IOException, org.bouncycastle.openpgp.PGPException
Return theOpenPgpV4Fingerprint
of our signing key.- Returns:
- fingerprint of signing key
- Throws:
IOException
- IO is dangerousorg.bouncycastle.openpgp.PGPException
- PGP is brittle
-
getAnnouncedPublicKeys
public org.bouncycastle.openpgp.PGPPublicKeyRingCollection getAnnouncedPublicKeys() throws IOException, org.bouncycastle.openpgp.PGPException
Return aPGPPublicKeyRingCollection
containing only the public keys belonging to our signing key ring. TODO: Add support for public keys of other devices of the owner.- Overrides:
getAnnouncedPublicKeys
in classOpenPgpContact
- Returns:
- public keys
- Throws:
IOException
- IO is dangerous.org.bouncycastle.openpgp.PGPException
- PGP is brittle.
-
-