From 3c741ab969f283ba862af7c7e455b218dddc63df Mon Sep 17 00:00:00 2001 From: Macocian Alexandru Victor Date: Tue, 7 Jun 2022 12:49:39 +0200 Subject: [PATCH] Make AesEncrypter disposable (#19) --- .../Encryption/AesEncrypter.cs | 7 ++++++- .../SystemExtensions.NetStandard.Security.csproj | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SystemExtensions.NetStandard.Security/Encryption/AesEncrypter.cs b/SystemExtensions.NetStandard.Security/Encryption/AesEncrypter.cs index adcd6c5..de97242 100644 --- a/SystemExtensions.NetStandard.Security/Encryption/AesEncrypter.cs +++ b/SystemExtensions.NetStandard.Security/Encryption/AesEncrypter.cs @@ -6,7 +6,7 @@ using System.Security.Utilities; namespace System.Security.Encryption { - public sealed class AesEncrypter : ISymmetricEncrypter + public sealed class AesEncrypter : ISymmetricEncrypter, IDisposable { private readonly Aes aes; @@ -218,5 +218,10 @@ namespace System.Security.Encryption { return new MemoryStream(value); } + + public void Dispose() + { + this.aes.Dispose(); + } } } diff --git a/SystemExtensions.NetStandard.Security/SystemExtensions.NetStandard.Security.csproj b/SystemExtensions.NetStandard.Security/SystemExtensions.NetStandard.Security.csproj index dab95f0..71e8276 100644 --- a/SystemExtensions.NetStandard.Security/SystemExtensions.NetStandard.Security.csproj +++ b/SystemExtensions.NetStandard.Security/SystemExtensions.NetStandard.Security.csproj @@ -7,7 +7,7 @@ LICENSE true System - 1.2.4 + 1.2.5 Alexandru Macocian https://github.com/AlexMacocian/SystemExtensions Security extensions for the System namespace