/** * 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; _remoteAddress = remoteAddress; _sessionBuilder = new SessionBuilder(sessionStore, preKeyStore, signedPreKeyStore, identityKeyStore, remoteAddress); }
/// <summary> /// Constructs a SessionBuilder. /// </summary> /// <param name="sessionStore">The {@link org.whispersystems.libsignal.state.SessionStore} to store the constructed session in.</param> /// <param name="preKeyStore">The {@link org.whispersystems.libsignal.state.PreKeyStore} where the client's local {@link org.whispersystems.libsignal.state.PreKeyRecord}s are stored.</param> /// <param name="signedPreKeyStore"></param> /// <param name="identityKeyStore">The {@link org.whispersystems.libsignal.state.IdentityKeyStore} containing the client's identity key information.</param> /// <param name="remoteAddress">The address of the remote user to build a session with.</param> public SessionBuilder(ISessionStore sessionStore, IPreKeyStore preKeyStore, ISignedPreKeyStore signedPreKeyStore, IDentityKeyStore identityKeyStore, SignalProtocolAddress remoteAddress) { _sessionStore = sessionStore; _preKeyStore = preKeyStore; _signedPreKeyStore = signedPreKeyStore; _identityKeyStore = identityKeyStore; _remoteAddress = remoteAddress; }