/** * Construct a SessionCipher for encrypt/decrypt operations on a session. * In order to use SessionCipher, a session must have already been created * and stored using {@link SessionBuilder}. * * @param sessionStore The {@link SessionStore} that contains a session for this recipient. * @param remoteAddress The remote address that messages will be encrypted to or decrypted from. */ public SessionCipher(ISessionStore sessionStore, IPreKeyStore preKeyStore, ISignedPreKeyStore signedPreKeyStore, IDentityKeyStore identityKeyStore, SignalProtocolAddress remoteAddress) { _sessionStore = sessionStore; _preKeyStore = preKeyStore; _identityKeyStore = identityKeyStore; _remoteAddress = remoteAddress; _sessionBuilder = new SessionBuilder(sessionStore, preKeyStore, signedPreKeyStore, identityKeyStore, remoteAddress); }
public override bool Equals(Object other) { if (other == null) { return(false); } if (!(other is SignalProtocolAddress)) { return(false); } SignalProtocolAddress that = (SignalProtocolAddress)other; return(Name.Equals(that.Name) && DeviceId == that.DeviceId); }
/// <summary> /// Constructs a SessionBuilder /// </summary> /// <param name="store">The <see "SignalProtocolStore" /> to store all state information in.</param> /// <param name="remoteAddress">The address of the remote user to build a session with.</param> /// <returns></returns> public SessionBuilder(ISignalProtocolStore store, SignalProtocolAddress remoteAddress) : this(store, store, store, store, remoteAddress) { }