clsPassword¶
clsPassword generates external-user passwords and validates proposed passwords against the library's length, complexity, and identity-matching checks.
Purpose¶
- Generate random passwords using configurable uppercase, lowercase, numeric, and symbol character sets.
- Validate submitted passwords against length, complexity, and no-name/no-user-ID rules.
Context¶
- Namespace:
SAIF.Business.External.Users* - Assembly/package:
SAIF.BOF.Business.External.Users - Likely uses
SAIF.HashUtilfor hashing operations, per the nuspec dependency.*
Public members¶
| Member | Signature | Purpose |
|---|---|---|
SPECIAL_CHARS |
Public Const SPECIAL_CHARS As String = "#$@%?*" |
Represents the special chars constant with value "#$@%?*".* |
CHARS_TO_EXCLUDE |
Public Const CHARS_TO_EXCLUDE As String = "1l0O" |
Represents the chars to exclude constant with value "1l0O".* |
SpecialCharsToInclude |
Public Property SpecialCharsToInclude As Char() = SPECIAL_CHARS.ToCharArray |
Indicates all the special characters that will be included by the generator. |
IncludeUpper |
Public Property IncludeUpper As Boolean = True |
Determines if upper-case letters are included by the generator. |
IncludeLower |
Public Property IncludeLower As Boolean = False |
Determines if lower-case letters are included by the generator. |
IncludeNumbers |
Public Property IncludeNumbers As Boolean = True |
Determines if numbers 0-9 are included by the generator. |
IncludeSymbol |
Public Property IncludeSymbol As Boolean = True |
Gets or sets the include symbol.* |
CharsToExclude |
Public Property CharsToExclude As Char() = CHARS_TO_EXCLUDE.ToCharArray |
Indicates all characters that will be excluded by the generator. |
New |
Public Sub New(Optional includeUpper As Boolean = True, Optional includeLower As Boolean = True, Optional includeNumbers As Boolean = True, Optional includeSymbol As Boolean = False) |
Initializes a new instance of clsPassword.* |
Generate |
Public Function Generate(Optional passwordLength As Integer = 8, Optional numSpecialChars As Integer = 0) As String |
Generates .* |
IsValid |
Public Function IsValid(password As String, userId As String, firstName As String, lastName As String) As PasswordValdationResult |
Returns whether valid.* |
Behavioral notes¶
Generateremoves excluded characters from all candidate character lists before it assembles the password.IsValidreturns aPasswordValdationResultpopulated with UI resource messages for each failed validation rule.
Constraints and usage notes¶
Generatecan append extra required characters, so the final password can exceed the requested base length.- Validation messages come from
UI_ExternalSecurityMaintenanceresource strings.
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Business\SAIF.Business.External.Users\clsPassword.vb