Adds Argon2 for password protection (#123)
This commit is contained in:
parent
29467a3ed9
commit
dad8a64fad
54 changed files with 1152 additions and 167 deletions
20
Projects/Argon2/Argon2Exception.cs
Normal file
20
Projects/Argon2/Argon2Exception.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Accounting.Security
|
||||
{
|
||||
/// <summary>
|
||||
/// An exception class to wrap the errors returned by Daniel Dinu and Dmitry Khovratovich's Argon2 library.
|
||||
///
|
||||
/// Except through very unusual conditions, the only exceptions which could be thrown from PasswordHasher
|
||||
/// are Argon2Exception, ArgumentNullException, DllNotFoundException (if libargon2.dll is not found)
|
||||
/// </summary>
|
||||
public class Argon2Exception : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Construct an Argon2Exception with the specified Argon2 error code
|
||||
/// <param name="action">Which method the Argon2Exception originated from</param>
|
||||
/// <param name="error">The error returned from the Argon2 library</param>
|
||||
/// </summary>
|
||||
public Argon2Exception(string action, Argon2Error error) : base(string.Format("Error during Argon2 {0}: ({1}) {2}", action, (int)error, error)) {}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue