Exemple #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,
                             AxolotlAddress remoteAddress)
        {
            this.sessionStore   = sessionStore;
            this.preKeyStore    = preKeyStore;
            this.remoteAddress  = remoteAddress;
            this.sessionBuilder = new SessionBuilder(sessionStore, preKeyStore, signedPreKeyStore,
                                                     identityKeyStore, remoteAddress);
        }
Exemple #2
0
        /**
         * Constructs a SessionBuilder.
         *
         * @param sessionStore The {@link org.whispersystems.libaxolotl.state.SessionStore} to store the constructed session in.
         * @param preKeyStore The {@link  org.whispersystems.libaxolotl.state.PreKeyStore} where the client's local {@link org.whispersystems.libaxolotl.state.PreKeyRecord}s are stored.
         * @param identityKeyStore The {@link org.whispersystems.libaxolotl.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,
                              AxolotlAddress remoteAddress)
        {
            this.sessionStore      = sessionStore;
            this.preKeyStore       = preKeyStore;
            this.signedPreKeyStore = signedPreKeyStore;
            this.identityKeyStore  = identityKeyStore;
            this.remoteAddress     = remoteAddress;
        }
Exemple #3
0
        public override bool Equals(Object other)
        {
            if (other == null)
            {
                return(false);
            }
            if (!(other is AxolotlAddress))
            {
                return(false);
            }

            AxolotlAddress that = (AxolotlAddress)other;

            return(this.name.Equals(that.name) && this.deviceId == that.deviceId);
        }
Exemple #4
0
        /**
         * Constructs a SessionBuilder
         * @param store The {@link org.whispersystems.libaxolotl.state.AxolotlStore} to store all state information in.
         * @param remoteAddress The address of the remote user to build a session with.
         */

        public SessionBuilder(AxolotlStore store, AxolotlAddress remoteAddress)
            : this(store, store, store, store, remoteAddress)
        {
        }