AzDevTeam.PasswordValidator
1.0.1
dotnet add package AzDevTeam.PasswordValidator --version 1.0.1
NuGet\Install-Package AzDevTeam.PasswordValidator -Version 1.0.1
<PackageReference Include="AzDevTeam.PasswordValidator" Version="1.0.1" />
paket add AzDevTeam.PasswordValidator --version 1.0.1
#r "nuget: AzDevTeam.PasswordValidator, 1.0.1"
// Install AzDevTeam.PasswordValidator as a Cake Addin #addin nuget:?package=AzDevTeam.PasswordValidator&version=1.0.1 // Install AzDevTeam.PasswordValidator as a Cake Tool #tool nuget:?package=AzDevTeam.PasswordValidator&version=1.0.1
Password Validation Library
This program provides functionality to validate a password based on various conditions like length, containing uppercase and lowercase letters, numbers, symbols, etc. The program is written in C# and uses Regular Expressions to match patterns.
How to use
- Include the PasswordValidator namespace.
- Create an instance of the PasswordValidation class.
- Call the ValidatePassword() method, passing the password and confirm password strings as arguments.
- The method returns an instance of the PasswordValidationResult class that indicates whether the password is valid or not.
- You can also pass an instance of the PasswordValidationConfiguration class to customize the validation conditions.
Methods
ValidatePassword(string password, string confirmPassword)
This method validates the password and confirm password strings and returns a PasswordValidationResult instance.
ValidatePassword(string password, string confirmPassword, PasswordValidationConfiguration configuration)
This method validates the password and confirm password strings and returns a PasswordValidationResult instance based on the specified PasswordValidationConfiguration conditions.
PasswordValidationResult
This class represents the result of password validation.
Properties
IsValid
This property gets a value indicating whether the password is valid or not.
FailureMessages
This property gets a list of failure messages if the password is not valid.
PasswordValidationConfiguration
This class represents the configuration options for password validation.
Properties
ContainWhiteSpace
This property indicates whether the password should contain white space or not.
ContainUpperCase
This property indicates whether the password should contain uppercase letters or not.
ContainLowerCase
This property indicates whether the password should contain lowercase letters or not.
ContainNumber
This property indicates whether the password should contain numbers or not.
ContainSymbol
This property indicates whether the password should contain symbols or not.
MinimumLength
This property indicates the minimum length of the password.
FailureMessages
This property contains a list of failure messages for each validation condition.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
General Password Validator With Configurations