2
0

ICryptoProvider.cs 714 B

123456789101112131415161718192021222324
  1. #pragma warning disable CS1591
  2. using System;
  3. namespace MediaBrowser.Model.Cryptography
  4. {
  5. public interface ICryptoProvider
  6. {
  7. string DefaultHashMethod { get; }
  8. /// <summary>
  9. /// Creates a new <see cref="PasswordHash" /> instance.
  10. /// </summary>
  11. /// <param name="password">The password that will be hashed.</param>
  12. /// <returns>A <see cref="PasswordHash" /> instance with the hash method, hash, salt and number of iterations.</returns>
  13. PasswordHash CreatePasswordHash(ReadOnlySpan<char> password);
  14. bool Verify(PasswordHash hash, ReadOnlySpan<char> password);
  15. byte[] GenerateSalt();
  16. byte[] GenerateSalt(int length);
  17. }
  18. }