Ejemplo n.º 1
0
 protected string GenerateSalt(IPasswordSaltProvider saltProvider)
 {
     if (saltProvider == null)
     {
         return(string.Empty);
     }
     return(saltProvider.GetPasswordSalt());
 }
Ejemplo n.º 2
0
 public static string EncodePassword(string passwordInClearText, IPasswordSaltProvider saltProvider)
 {
     return(PasswordHashProvider.EncodePassword(passwordInClearText, saltProvider));
 }
Ejemplo n.º 3
0
 protected override bool Check(string text, string hash, IPasswordSaltProvider saltProvider)
 {
     return(EncodeRaw(text) == hash);
 }
Ejemplo n.º 4
0
 protected override string Encode(string text, IPasswordSaltProvider saltProvider)
 {
     return(EncodeRaw(text));
 }
Ejemplo n.º 5
0
 protected override bool Check(string text, string hash, IPasswordSaltProvider saltProvider)
 {
     return(BCrypt.Verify(text + GenerateSalt(saltProvider), hash));
 }
Ejemplo n.º 6
0
 protected override string Encode(string text, IPasswordSaltProvider saltProvider)
 {
     return(BCrypt.HashPassword(text + GenerateSalt(saltProvider)));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Implementation of the hash generator. Uses the saltProvider if there is.
 /// </summary>
 protected abstract string Encode(string text, IPasswordSaltProvider saltProvider);
Ejemplo n.º 8
0
 /// <summary>
 /// Implementation of the checking of the password-hash match. Uses the saltProvider if there is.
 /// </summary>
 protected abstract bool Check(string text, string hash, IPasswordSaltProvider saltProvider);
Ejemplo n.º 9
0
 /// <summary>
 /// Generates a hash from the given password with the saltProvider if there is.
 /// </summary>
 public static string EncodePassword(string passwordInClearText, IPasswordSaltProvider saltProvider)
 {
     return(Instance.Encode(passwordInClearText, saltProvider));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Checks the password by the given hash and saltProvider with the configured or default PasswordHashProvider.
 /// According to configuration does the migration too.
 /// </summary>
 public static bool CheckPassword(string passwordInClearText, string hash, IPasswordSaltProvider saltProvider)
 {
     return(Instance.Check(passwordInClearText, hash, saltProvider));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Checks the password by the given hash and saltProvider with the configured or default OutdatedPasswordHashProvider.
 /// </summary>
 public static bool CheckPasswordForMigration(string passwordInClearText, string hash, IPasswordSaltProvider saltProvider)
 {
     return(OutdatedInstance.Check(passwordInClearText, hash, saltProvider));
 }
 public override bool Check(string text, string hash, IPasswordSaltProvider saltProvider)
 {
     return(EncodeRaw(text + GenerateSalt(saltProvider)) == hash);
 }
 public override string Encode(string text, IPasswordSaltProvider saltProvider)
 {
     return(EncodeRaw(text + GenerateSalt(saltProvider)));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Implementation of the checking of the password-hash match. Uses the saltProvider if there is.
 /// </summary>
 public abstract bool Check(string text, string hash, IPasswordSaltProvider saltProvider);
Ejemplo n.º 15
0
 /// <summary>
 /// Implementation of the hash generator. Uses the saltProvider if there is.
 /// </summary>
 public abstract string Encode(string text, IPasswordSaltProvider saltProvider);