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