diff --git a/src/StevanFreeborn.Extensions.Configuration.Secure/Configuration/SecureConfig.cs b/src/StevanFreeborn.Extensions.Configuration.Secure/Configuration/SecureConfig.cs new file mode 100644 index 0000000..6fe2ad7 --- /dev/null +++ b/src/StevanFreeborn.Extensions.Configuration.Secure/Configuration/SecureConfig.cs @@ -0,0 +1,38 @@ +using StevanFreeborn.Extensions.Configuration.Secure.Cryptography; +using StevanFreeborn.Extensions.Configuration.Secure.Storage; + +namespace StevanFreeborn.Extensions.Configuration.Secure.Configuration; + +internal interface ISecureConfig +{ + Task DeleteAsync(string key, CancellationToken ct = default); + Task GetAsync(string key, CancellationToken ct = default); + Task SetAsync(string key, T value, CancellationToken ct = default); +} + +internal sealed class SecureConfig( + ISecureStorageProvider storageProvider, + ICryptoProvider cryptoProvider +) : ISecureConfig +{ + private readonly ISecureStorageProvider _storageProvider = storageProvider ?? + throw new ArgumentNullException(nameof(storageProvider)); + + private readonly ICryptoProvider _cryptoProvider = cryptoProvider ?? + throw new ArgumentNullException(nameof(cryptoProvider)); + + public async Task SetAsync(string key, T value, CancellationToken ct = default) + { + throw new NotImplementedException(); + } + + public async Task GetAsync(string key, CancellationToken ct = default) + { + throw new NotImplementedException(); + } + + public async Task DeleteAsync(string key, CancellationToken ct = default) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/StevanFreeborn.Extensions.Configuration.Secure/Cryptography/ICryptoProvider.cs b/src/StevanFreeborn.Extensions.Configuration.Secure/Cryptography/ICryptoProvider.cs new file mode 100644 index 0000000..4009509 --- /dev/null +++ b/src/StevanFreeborn.Extensions.Configuration.Secure/Cryptography/ICryptoProvider.cs @@ -0,0 +1,7 @@ +namespace StevanFreeborn.Extensions.Configuration.Secure.Cryptography; + +internal interface ICryptoProvider +{ + string Encrypt(string plainText); + string Decrypt(string cipherText); +} \ No newline at end of file