Example #1
0
        /// <summary> Method init is used to construct various static data
        /// used in the SASL OTP profile.
        /// </summary>
        public virtual StartChannelListener init(System.String uri, ProfileConfiguration config)
        {
            md5 = new MD5();
            sha1 = new SHA1();
            authenticators = new System.Collections.Hashtable();

            if (instance_Renamed_Field == null)
            {
                instance_Renamed_Field = this;
                algorithms = new System.Collections.Hashtable();

                SupportClass.PutElement(algorithms, MD5.AlgorithmName, md5);
                SupportClass.PutElement(algorithms, SHA1.AlgorithmName, sha1);
                userDatabase = new UserDatabasePool();
            }

            return this;
        }
Example #2
0
        private void init(SASLOTPProfile otpProfile, UserDatabase db, System.String pwd, System.String authorizedId, System.String authenticateId)
        {
            log.debug("OTP Authenticator Initiator Construtor");

            authenticated = authenticateId;
            authorized = authorizedId;
            credential = new System.Collections.Hashtable();
            database = db;

            if (log.isDebugEnabled())
            {
                log.debug("Dict.getA()" + database.AlgorithmName);
                //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Object.toString' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"'
                log.debug("Dict.getA()" + SASLOTPProfile.getAlgorithm(database.AlgorithmName));
            }

            algorithm = SASLOTPProfile.getAlgorithm(database.AlgorithmName);
            profile = otpProfile;
            password = pwd;
            state = STATE_UNKNOWN;

            SupportClass.PutElement(credential, SessionCredential.AUTHENTICATOR_TYPE, SASLOTPProfile.MECHANISM);
            SupportClass.PutElement(credential, SessionCredential.ALGORITHM, algorithm.Name);
            SupportClass.PutElement(credential, SessionCredential.AUTHENTICATOR, authenticateId);

            if ((System.Object) authorizedId == null || authorizedId.Equals(""))
            {
                SupportClass.PutElement(credential, SessionCredential.AUTHORIZED, authenticateId);
            }
            else
            {
                SupportClass.PutElement(credential, SessionCredential.AUTHORIZED, authorizedId);
            }
        }
Example #3
0
 /// <summary> Initiator API
 /// 
 /// ALL of the routines below are the Initiator calls.
 /// </summary>
 internal OTPAuthenticator(SASLOTPProfile otpProfile, UserDatabase db, System.String pwd, System.String authorizedId, System.String authenticateId)
 {
     InitBlock();
     init(otpProfile, db, pwd, authorizedId, authenticateId);
 }
Example #4
0
 // Weird init version
 internal OTPAuthenticator(SASLOTPProfile otpProfile, UserDatabase db, System.String pwd, System.String authorizedId, System.String authenticateId, System.String newAlgorithm, System.String newHash, System.String newSeed, System.String newSequence)
 {
     InitBlock();
     System.Text.StringBuilder sb = new System.Text.StringBuilder(128);
     sb.Append(COLON);
     sb.Append(newAlgorithm);
     sb.Append(SPACE);
     sb.Append(newSequence);
     sb.Append(SPACE);
     sb.Append(newSeed.ToLower());
     sb.Append(COLON);
     sb.Append(newHash);
     initData = sb.ToString();
     init(otpProfile, db, pwd, authorizedId, authenticateId);
 }
Example #5
0
        /// <summary> Listener API
        /// 
        /// All of the routines below, but prior to the Initiator API,
        /// are the Listener calls
        /// </summary>
        internal OTPAuthenticator(SASLOTPProfile otpProfile)
        {
            InitBlock();
            log.debug("Creating Listener OTP Authenticator");

            authenticated = null;
            authorized = null;
            credential = new System.Collections.Hashtable();
            database = null;
            password = null;
            profile = otpProfile;
            state = STATE_UNKNOWN;

            SupportClass.PutElement(credential, SessionCredential.AUTHENTICATOR_TYPE, SASLOTPProfile.MECHANISM);
        }