Esempio 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(SessionStore sessionStore, PreKeyStore preKeyStore,
                      SignedPreKeyStore signedPreKeyStore, IdentityKeyStore identityKeyStore,
                      SignalProtocolAddress remoteAddress)
 {
     this.sessionStore  = sessionStore;
     this.preKeyStore   = preKeyStore;
     this.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(SessionStore sessionStore,
                       PreKeyStore preKeyStore,
                       SignedPreKeyStore signedPreKeyStore,
                       IdentityKeyStore identityKeyStore,
                       SignalProtocolAddress remoteAddress)
 {
     this.sessionStore      = sessionStore;
     this.preKeyStore       = preKeyStore;
     this.signedPreKeyStore = signedPreKeyStore;
     this.identityKeyStore  = identityKeyStore;
     this.remoteAddress     = remoteAddress;
 }
Esempio 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(this.name.Equals(that.name) && this.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(SignalProtocolStore store, SignalProtocolAddress remoteAddress)
     : this(store, store, store, store, remoteAddress)
 {
 }