aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Cryptography/ICryptoProvider.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-09-17 18:07:15 +0200
committerAnthony Lavado <anthony@lavado.ca>2019-09-17 12:07:15 -0400
commit6f17a0b7af5775386e554f2e2e2a4a6829d2895d (patch)
treece792d21af0f8e5d0208aec1aba55e8047f2f439 /MediaBrowser.Model/Cryptography/ICryptoProvider.cs
parentadc2a68a98a572e6541ffac587fd9f6247aec6d5 (diff)
Remove legacy auth code (#1677)
* Remove legacy auth code * Adds tests so we don't break PasswordHash (again) * Clean up interfaces * Remove duplicate code * Use auto properties * static using * Don't use 'this' * Fix build
Diffstat (limited to 'MediaBrowser.Model/Cryptography/ICryptoProvider.cs')
-rw-r--r--MediaBrowser.Model/Cryptography/ICryptoProvider.cs19
1 files changed, 8 insertions, 11 deletions
diff --git a/MediaBrowser.Model/Cryptography/ICryptoProvider.cs b/MediaBrowser.Model/Cryptography/ICryptoProvider.cs
index 9e85beb43c..ce6493232f 100644
--- a/MediaBrowser.Model/Cryptography/ICryptoProvider.cs
+++ b/MediaBrowser.Model/Cryptography/ICryptoProvider.cs
@@ -1,5 +1,3 @@
-using System;
-using System.IO;
using System.Collections.Generic;
namespace MediaBrowser.Model.Cryptography
@@ -7,20 +5,19 @@ namespace MediaBrowser.Model.Cryptography
public interface ICryptoProvider
{
string DefaultHashMethod { get; }
- [Obsolete("Use System.Security.Cryptography.MD5 directly")]
- Guid GetMD5(string str);
- [Obsolete("Use System.Security.Cryptography.MD5 directly")]
- byte[] ComputeMD5(Stream str);
- [Obsolete("Use System.Security.Cryptography.MD5 directly")]
- byte[] ComputeMD5(byte[] bytes);
- [Obsolete("Use System.Security.Cryptography.SHA1 directly")]
- byte[] ComputeSHA1(byte[] bytes);
+
IEnumerable<string> GetSupportedHashMethods();
+
byte[] ComputeHash(string HashMethod, byte[] bytes);
+
byte[] ComputeHashWithDefaultMethod(byte[] bytes);
+
byte[] ComputeHash(string HashMethod, byte[] bytes, byte[] salt);
+
byte[] ComputeHashWithDefaultMethod(byte[] bytes, byte[] salt);
- byte[] ComputeHash(PasswordHash hash);
+
byte[] GenerateSalt();
+
+ byte[] GenerateSalt(int length);
}
}