diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-11-13 16:56:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-13 16:56:25 -0700 |
| commit | 34df1a030bdefad3b5b1ca0553a85f59d046326f (patch) | |
| tree | d9d123a0c1e65e58033a48e4b4c4932ad3c60780 /MediaBrowser.Common/Cryptography/CryptoExtensions.cs | |
| parent | 761a4e8415b2fc1023679c24ddd66fabf237abec (diff) | |
| parent | 5265b3eee794762b4de39a68b5bfbf767faaac36 (diff) | |
Merge pull request #6818 from Bond-009/password
Diffstat (limited to 'MediaBrowser.Common/Cryptography/CryptoExtensions.cs')
| -rw-r--r-- | MediaBrowser.Common/Cryptography/CryptoExtensions.cs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/MediaBrowser.Common/Cryptography/CryptoExtensions.cs b/MediaBrowser.Common/Cryptography/CryptoExtensions.cs deleted file mode 100644 index 157b0ed10..000000000 --- a/MediaBrowser.Common/Cryptography/CryptoExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using System.Globalization; -using System.Text; -using MediaBrowser.Model.Cryptography; -using static MediaBrowser.Common.Cryptography.Constants; - -namespace MediaBrowser.Common.Cryptography -{ - /// <summary> - /// Class containing extension methods for working with Jellyfin cryptography objects. - /// </summary> - public static class CryptoExtensions - { - /// <summary> - /// Creates a new <see cref="PasswordHash" /> instance. - /// </summary> - /// <param name="cryptoProvider">The <see cref="ICryptoProvider" /> instance used.</param> - /// <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> - public static PasswordHash CreatePasswordHash(this ICryptoProvider cryptoProvider, string password) - { - byte[] salt = cryptoProvider.GenerateSalt(); - return new PasswordHash( - cryptoProvider.DefaultHashMethod, - cryptoProvider.ComputeHashWithDefaultMethod( - Encoding.UTF8.GetBytes(password), - salt), - salt, - new Dictionary<string, string> - { - { "iterations", DefaultIterations.ToString(CultureInfo.InvariantCulture) } - }); - } - } -} |
