/// <summary>
        /// Creates a client that will authenticate with the specified 
        /// username and password.
        /// </summary>
        /// <param name="username">the username</param>
        /// <param name="password">the password</param>
        public SrpClient(string username, string password)
        {
            if (username == null)
                throw new ArgumentNullException("username");
            if (password == null)
                throw new ArgumentNullException("username");
         

            m_credentials = new PBDKFCredentials(username, password);
            if (m_credentials.UsernameBytes.Length > 1024)
                throw new ArgumentException("Username cannot consume more than 1024 bytes encoded as UTF8", "username");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a client that will authenticate with the specified
        /// username and password.
        /// </summary>
        /// <param name="username">the username</param>
        /// <param name="password">the password</param>
        public SrpClient(string username, string password)
        {
            if (username == null)
            {
                throw new ArgumentNullException("username");
            }
            if (password == null)
            {
                throw new ArgumentNullException("username");
            }


            m_credentials = new PBDKFCredentials(username, password);
            if (m_credentials.UsernameBytes.Length > 1024)
            {
                throw new ArgumentException("Username cannot consume more than 1024 bytes encoded as UTF8", "username");
            }
        }