Skip to content

Commit

Permalink
[Add] Rsa object Dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
stulzq committed Jul 9, 2019
1 parent 8f3639a commit e5d84ee
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions XC.RSAUtil/RSAUtilBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace XC.RSAUtil
{
public abstract class RSAUtilBase
public abstract class RSAUtilBase:IDisposable
{
public RSA PrivateRsa;
public RSA PublicRsa;
Expand Down Expand Up @@ -96,5 +96,11 @@ public bool VerifyData(string data, string sign, HashAlgorithmName hashAlgorithm

protected abstract RSAParameters CreateRsapFromPrivateKey(string privateKey);
protected abstract RSAParameters CreateRsapFromPublicKey(string publicKey);
}

public void Dispose()
{
PrivateRsa?.Dispose();
PublicRsa?.Dispose();
}
}
}

0 comments on commit e5d84ee

Please sign in to comment.