Exemple #1
0
        /// <summary>
        /// All available analyzers will be run against the password.
        /// <para>Internet access will be required.</para>
        /// </summary>
        /// <returns>A <see cref="Task{TResult}"/> with the <see cref="FullAnalyzerResult"/> containing the result of the analysis.</returns>
        public async Task <FullAnalyzerResult> RunFullAnalyzerAsync()
        {
            StringPatternAnalyzer       stringPatternAnalyzer       = new StringPatternAnalyzer(password);
            StringPatternAnalyzerResult stringPatternAnalyzerResult = stringPatternAnalyzer.Run();
            PasswordLeakAnalyzer        passwordLeakAnalyzer        = new PasswordLeakAnalyzer(password);
            PasswordLeakAnalyzerResult  passwordLeakAnalyzerResult  = await passwordLeakAnalyzer.Run();

            return(new FullAnalyzerResult(stringPatternAnalyzerResult, passwordLeakAnalyzerResult));
        }
Exemple #2
0
 /// <summary>
 /// Constructs a new <see cref="FullAnalyzerResult"/> object from existing <seealso cref="AnalyzerResult"/> objects.
 /// </summary>
 /// <param name="stringPatternAnalyzerResult">The <see cref="StringPatternAnalyzerResult"/> for the password.</param>
 /// <param name="passwordLeakAnalyzerResult">The <see cref="PasswordLeakAnalyzerResult"/> for the password.</param>
 public FullAnalyzerResult(StringPatternAnalyzerResult stringPatternAnalyzerResult, PasswordLeakAnalyzerResult passwordLeakAnalyzerResult) : base(stringPatternAnalyzerResult.IsSecure && passwordLeakAnalyzerResult.IsSecure)
 {
     StringPatternAnalyzerResult = stringPatternAnalyzerResult;
     PasswordLeakAnalyzerResult  = passwordLeakAnalyzerResult;
     PasswordSecurityLevel       = (PasswordSecurityLevel)Math.Min((byte)stringPatternAnalyzerResult.PasswordSecurityLevel, (byte)passwordLeakAnalyzerResult.PasswordSecurityLevel);
 }