Table of Contents

Class RequiredCharactersPasswordRule

Namespace
The.Security.Password
Assembly
Instagile.dll

Requires that a password contains at least minimumCount required characters.

public class RequiredCharactersPasswordRule : IPasswordRule
Inheritance
RequiredCharactersPasswordRule
Implements
Derived
Inherited Members

Constructors

RequiredCharactersPasswordRule(Func<char, bool>, string, int)

Requires that a password contains at least minimumCount required characters.

public RequiredCharactersPasswordRule(Func<char, bool> isRequiredCharacter, string requirement, int minimumCount = 1)

Parameters

isRequiredCharacter Func<char, bool>

Delegate that returns true iff the parameter is a required character.

requirement string

An explanation of the type of characters required by this rule.

minimumCount int

The minimum number of required characters that must be present in the password.

Properties

Description

A description of this password rule.

public string Description { get; }

Property Value

string

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

string

MinimumCount

public int MinimumCount { get; }

Property Value

int

Methods

IsValid(string, IEnumerable<string>?)

Validate the supplied password against this rule.

public bool IsValid(string password, IEnumerable<string>? userDataStrings = null)

Parameters

password string

The password to validate

userDataStrings IEnumerable<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.