Class MinimumStrengthPasswordRule
public sealed class MinimumStrengthPasswordRule : IPasswordRule
- Inheritance
-
MinimumStrengthPasswordRule
- Implements
- Inherited Members
Constructors
MinimumStrengthPasswordRule(PasswordStrength)
public MinimumStrengthPasswordRule(PasswordStrength minimumStrength)
Parameters
minimumStrengthPasswordStrength
Properties
Description
A description of this password rule.
public string Description { get; }
Property Value
Instructions
A string that may be shown to the user when their password is deemed invalid by this rule.
public string Instructions { get; }
Property Value
MinimumStrength
public PasswordStrength MinimumStrength { get; }
Property Value
Methods
GetPasswordScore(string, IEnumerable<string>?)
public static double GetPasswordScore(string password, IEnumerable<string>? userDataStrings = null)
Parameters
passwordstringuserDataStringsIEnumerable<string>
Returns
GetPasswordStrength(string, IEnumerable<string>?)
public static PasswordStrength GetPasswordStrength(string password, IEnumerable<string>? userDataStrings = null)
Parameters
passwordstringuserDataStringsIEnumerable<string>
Returns
GetScoreStrength(double)
public static PasswordStrength GetScoreStrength(double score)
Parameters
scoredouble
Returns
IsValid(string, IEnumerable<string>?)
Validate the supplied password against this rule.
public bool IsValid(string password, IEnumerable<string>? userDataStrings = null)
Parameters
passwordstringThe password to validate
userDataStringsIEnumerable<string>Strings that the application knows about the user supplying the password that this rule may use as part of password validation.
Returns
- bool
Whether the supplied password is valid under this rule.
IsValid(PasswordStrength)
public bool IsValid(PasswordStrength strength)
Parameters
strengthPasswordStrength