Class UntrustedOmemoIdentityException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.jivesoftware.smackx.omemo.exceptions.UntrustedOmemoIdentityException
-
- All Implemented Interfaces:
Serializable
public class UntrustedOmemoIdentityException extends Exception
Exception that gets thrown when we try to en-/decrypt a message for an untrusted contact. This might either be because the user actively untrusted a device, or we receive a message from a contact which contains an identityKey that differs from the one the user trusted.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UntrustedOmemoIdentityException(OmemoDevice device, OmemoFingerprint untrustedKey)
Constructor for when encryption fails because the user untrusted a recipients device.UntrustedOmemoIdentityException(OmemoDevice device, OmemoFingerprint fpTrusted, OmemoFingerprint fpUntrusted)
Constructor for when we receive a message with an identityKey different from the one we trusted.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OmemoDevice
getDevice()
Return the device which sent the message.String
getMessage()
OmemoFingerprint
getTrustedFingerprint()
Return the fingerprint of the key we expected.OmemoFingerprint
getUntrustedFingerprint()
Return the fingerprint of the unexpected untrusted key.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
UntrustedOmemoIdentityException
public UntrustedOmemoIdentityException(OmemoDevice device, OmemoFingerprint fpTrusted, OmemoFingerprint fpUntrusted)
Constructor for when we receive a message with an identityKey different from the one we trusted.- Parameters:
device
- device which sent the message.fpTrusted
- fingerprint of the identityKey we previously had and trusted.fpUntrusted
- fingerprint of the new key which is untrusted.
-
UntrustedOmemoIdentityException
public UntrustedOmemoIdentityException(OmemoDevice device, OmemoFingerprint untrustedKey)
Constructor for when encryption fails because the user untrusted a recipients device.- Parameters:
device
- device the user wants to encrypt for, but which has been marked as untrusted.untrustedKey
- fingerprint of that device.
-
-
Method Detail
-
getDevice
public OmemoDevice getDevice()
Return the device which sent the message.- Returns:
- omemoDevice.
-
getTrustedFingerprint
public OmemoFingerprint getTrustedFingerprint()
Return the fingerprint of the key we expected. This might return null in case this exception got thrown during encryption process.- Returns:
- the trusted fingerprint.
-
getUntrustedFingerprint
public OmemoFingerprint getUntrustedFingerprint()
Return the fingerprint of the unexpected untrusted key.- Returns:
- the OMEMO fingerprint.
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
-