コード例 #1
0
 protected string GenerateSalt(IPasswordSaltProvider saltProvider)
 {
     if (saltProvider == null)
     {
         return(string.Empty);
     }
     return(saltProvider.GetPasswordSalt());
 }
コード例 #2
0
ファイル: PasswordField.cs プロジェクト: vlslavik/SenseNet
 public static string EncodePassword(string passwordInClearText, IPasswordSaltProvider saltProvider)
 {
     return(PasswordHashProvider.EncodePassword(passwordInClearText, saltProvider));
 }
コード例 #3
0
 protected override bool Check(string text, string hash, IPasswordSaltProvider saltProvider)
 {
     return(EncodeRaw(text) == hash);
 }
コード例 #4
0
 protected override string Encode(string text, IPasswordSaltProvider saltProvider)
 {
     return(EncodeRaw(text));
 }
コード例 #5
0
 protected override bool Check(string text, string hash, IPasswordSaltProvider saltProvider)
 {
     return(BCrypt.Verify(text + GenerateSalt(saltProvider), hash));
 }
コード例 #6
0
 protected override string Encode(string text, IPasswordSaltProvider saltProvider)
 {
     return(BCrypt.HashPassword(text + GenerateSalt(saltProvider)));
 }
コード例 #7
0
 /// <summary>
 /// Implementation of the hash generator. Uses the saltProvider if there is.
 /// </summary>
 protected abstract string Encode(string text, IPasswordSaltProvider saltProvider);
コード例 #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);
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #12
0
 public override bool Check(string text, string hash, IPasswordSaltProvider saltProvider)
 {
     return(EncodeRaw(text + GenerateSalt(saltProvider)) == hash);
 }
コード例 #13
0
 public override string Encode(string text, IPasswordSaltProvider saltProvider)
 {
     return(EncodeRaw(text + GenerateSalt(saltProvider)));
 }
コード例 #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);
コード例 #15
0
 /// <summary>
 /// Implementation of the hash generator. Uses the saltProvider if there is.
 /// </summary>
 public abstract string Encode(string text, IPasswordSaltProvider saltProvider);