org.signal.libsignal.metadata.ProtocolInvalidKeyException Java Examples
The following examples show how to use
org.signal.libsignal.metadata.ProtocolInvalidKeyException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SignalServiceContent.java From mollyim-android with GNU General Public License v3.0 | 5 votes |
public static SignalServiceContent deserialize(byte[] data) { try { if (data == null) return null; SignalServiceContentProto signalServiceContentProto = SignalServiceContentProto.parseFrom(data); return createFromProto(signalServiceContentProto); } catch (InvalidProtocolBufferException | ProtocolInvalidMessageException | ProtocolInvalidKeyException | UnsupportedDataMessageException e) { // We do not expect any of these exceptions if this byte[] has come from serialize. throw new AssertionError(e); } }
Example #2
Source File: Manager.java From signal-cli with GNU General Public License v3.0 | 5 votes |
private SignalServiceContent decryptMessage(SignalServiceEnvelope envelope) throws InvalidMetadataMessageException, ProtocolInvalidMessageException, ProtocolDuplicateMessageException, ProtocolLegacyMessageException, ProtocolInvalidKeyIdException, InvalidMetadataVersionException, ProtocolInvalidVersionException, ProtocolNoSessionException, ProtocolInvalidKeyException, SelfSendException, UnsupportedDataMessageException, org.whispersystems.libsignal.UntrustedIdentityException { SignalServiceCipher cipher = new SignalServiceCipher(account.getSelfAddress(), account.getSignalProtocolStore(), Utils.getCertificateValidator()); try { return cipher.decrypt(envelope); } catch (ProtocolUntrustedIdentityException e) { if (e.getCause() instanceof org.whispersystems.libsignal.UntrustedIdentityException) { org.whispersystems.libsignal.UntrustedIdentityException identityException = (org.whispersystems.libsignal.UntrustedIdentityException) e.getCause(); account.getSignalProtocolStore().saveIdentity(resolveSignalServiceAddress(identityException.getName()), identityException.getUntrustedIdentity(), TrustLevel.UNTRUSTED); throw identityException; } throw new AssertionError(e); } }