protected internal virtual void AddPasswordCheckerAndThrowErrorIfAlreadyAvailable(IPasswordEncryptor encryptor) { if (PasswordChecker.ContainsKey(encryptor.HashAlgorithmName())) { throw Log.HashAlgorithmForPasswordEncryptionAlreadyAvailableException(encryptor.HashAlgorithmName()); } PasswordChecker[encryptor.HashAlgorithmName()] = encryptor; }
public virtual string Encrypt(string password) { var prefix = PrefixHandler.GeneratePrefix(DefaultPasswordEncryptor.HashAlgorithmName()); return(prefix + DefaultPasswordEncryptor.Encrypt(password)); }
protected internal virtual void AddDefaultEncryptor(IPasswordEncryptor defaultPasswordEncryptor) { this.DefaultPasswordEncryptor = defaultPasswordEncryptor; PasswordChecker[defaultPasswordEncryptor.HashAlgorithmName()] = defaultPasswordEncryptor; }