} // func IsFilterEqualEx public static bool PasswordCompare(string testPassword, string passwordHash) => Passwords.PasswordCompare(testPassword, passwordHash);
/// <summary>Decode a password from a string.</summary> /// <param name="passwordValue">Password value.</param> /// <returns></returns> /// <remarks> /// If the password starts with /// - win0x:[windows protected hex-bytes] /// - win64:[base64 windows protected byte array] /// - plain:[plaintext] /// Nothing, it is a plain text password. /// /// Windows Protected password can be encode with powershell ConvertFrom-SecureString without the key argument. /// </remarks> public static SecureString DecodePassword(string passwordValue) => Passwords.DecodePassword(passwordValue);
/// <summary>Encode a password for decode password.</summary> /// <param name="password"></param> /// <param name="passwordType"></param> /// <returns></returns> public static string EncodePassword(SecureString password, string passwordType) => Passwords.EncodePassword(password, passwordType);
/// <summary>Parse a hash string to an hash array.</summary> /// <param name="passwordHash">Hash string.</param> /// <returns>Password hash.</returns> public static byte[] ParsePasswordHash(string passwordHash) => Passwords.ParsePasswordHash(passwordHash);