mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-24 02:39:46 +08:00
34 lines
922 B
C#
34 lines
922 B
C#
using Microsoft.Extensions.Options;
|
|
using System.Application.Models;
|
|
using System.Application.Security;
|
|
using System.Security.Cryptography;
|
|
|
|
namespace System.Application.Services.Implementation
|
|
{
|
|
/// <inheritdoc cref="ISecurityService"/>
|
|
public class SecurityService : SecurityServiceBase
|
|
{
|
|
protected readonly AppSettings settings;
|
|
|
|
public SecurityService(IOptions<AppSettings> options)
|
|
{
|
|
settings = options.Value;
|
|
}
|
|
|
|
public override Aes? Aes
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
return settings.Aes;
|
|
}
|
|
catch (IsNotOfficialChannelPackageException e)
|
|
{
|
|
Log.Error(nameof(SecurityService), e, nameof(ApiResponseCode.IsNotOfficialChannelPackage));
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |