mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
add basic open subtitle configuration
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using MediaBrowser.Controller.Security;
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Security
|
||||
{
|
||||
public class EncryptionManager : IEncryptionManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Encrypts the string.
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">value</exception>
|
||||
public string EncryptString(string value)
|
||||
{
|
||||
if (value == null) throw new ArgumentNullException("value");
|
||||
|
||||
return Encoding.Default.GetString(ProtectedData.Protect(Encoding.Default.GetBytes(value), null, DataProtectionScope.LocalMachine));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decrypts the string.
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">value</exception>
|
||||
public string DecryptString(string value)
|
||||
{
|
||||
if (value == null) throw new ArgumentNullException("value");
|
||||
|
||||
return Encoding.Default.GetString(ProtectedData.Unprotect(Encoding.Default.GetBytes(value), null, DataProtectionScope.LocalMachine));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user