2020-02-04 00:49:27 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2021-11-10 21:34:54 +00:00
|
|
|
using System;
|
2019-03-05 07:58:25 +00:00
|
|
|
|
|
|
|
namespace MediaBrowser.Model.Cryptography
|
|
|
|
{
|
|
|
|
public interface ICryptoProvider
|
|
|
|
{
|
2019-05-21 17:28:34 +00:00
|
|
|
string DefaultHashMethod { get; }
|
2019-09-17 16:07:15 +00:00
|
|
|
|
2021-11-10 21:34:54 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Creates a new <see cref="PasswordHash" /> instance.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="password">The password that will be hashed.</param>
|
|
|
|
/// <returns>A <see cref="PasswordHash" /> instance with the hash method, hash, salt and number of iterations.</returns>
|
|
|
|
PasswordHash CreatePasswordHash(ReadOnlySpan<char> password);
|
2019-09-17 16:07:15 +00:00
|
|
|
|
2021-11-10 21:34:54 +00:00
|
|
|
bool Verify(PasswordHash hash, ReadOnlySpan<char> password);
|
2019-09-17 16:07:15 +00:00
|
|
|
|
2019-01-31 08:24:53 +00:00
|
|
|
byte[] GenerateSalt();
|
2019-09-17 16:07:15 +00:00
|
|
|
|
|
|
|
byte[] GenerateSalt(int length);
|
2019-03-05 07:58:25 +00:00
|
|
|
}
|
|
|
|
}
|