示例#1
0
        public OTRSession(string my_unique_id, string my_buddy_unique_id)
        {
            if (string.IsNullOrEmpty(my_unique_id))
                throw new ArgumentException("OTRSession:My uique ID cannot be null/empty");

            if (string.IsNullOrEmpty(my_buddy_unique_id))
                throw new ArgumentException("OTRSession:My buddy's unique ID cannot be null/empty");

            if (my_buddy_unique_id.Equals(my_unique_id))
                throw new ArgumentException("OTRSession:My uique ID and My buddy's unique ID cannot be the same value");

            _my_unique_id = my_unique_id;
            _my_buddy_unique_id = my_buddy_unique_id;

            _ake_keys_manager = new AKEKeysManager();
            _otr_session_object = new OTRSessionObjects();

            _dsa_signer = new DSASigner();
            _signature_manager = new SignatureManager(_dsa_signer);
        }
示例#2
0
        public OTRSession(string my_unique_id, string my_buddy_unique_id, DSAKeyParams dsa_key_hex_strings, bool debug_mode)
        {
            if (dsa_key_hex_strings == null)
                throw new ArgumentException("OTRSession: The DSA key hex string object cannot be null");

            if (string.IsNullOrEmpty(my_unique_id))
                throw new ArgumentException("OTRSession:My uique ID cannot be null/empty");

            if (string.IsNullOrEmpty(my_buddy_unique_id))
                throw new ArgumentException("OTRSession:My buddy's unique ID cannot be null/empty");

            if (my_buddy_unique_id.Equals(my_unique_id))
                throw new ArgumentException("OTRSession:My uique ID and My buddy's unique ID cannot be the same value");

            _my_unique_id = my_unique_id;
            _my_buddy_unique_id = my_buddy_unique_id;

            _ake_keys_manager = new AKEKeysManager();
            _otr_session_object = new OTRSessionObjects();

            _dsa_signer = new DSASigner(dsa_key_hex_strings);
            _signature_manager = new SignatureManager(_dsa_signer);

            _debug_mode = debug_mode;
        }