Skip to content

Commit

Permalink
workaround bc ToRSA issue on Linux. bcgit/bc-csharp#160
Browse files Browse the repository at this point in the history
  • Loading branch information
qwer0516yp committed Apr 17, 2024
1 parent eef2fc9 commit 1e70061
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Authors>Owen Yuan</Authors>
<PackageId>CipherCracker.ClassLibrary</PackageId>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Version>1.0.2-alpha</Version>
<Version>1.0.2</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@

public static class RsaKeyExtensions
{
public static RSA ToRSA(this AsymmetricKeyParameter privateKeyParameter) => DotNetUtilities.ToRSA((RsaPrivateCrtKeyParameters)privateKeyParameter);
public static RSA ToRSA(this AsymmetricKeyParameter privateKeyParameter)
{
var rsa = RSA.Create();
rsa.ImportParameters(DotNetUtilities.ToRSAParameters((RsaPrivateCrtKeyParameters)privateKeyParameter));
return rsa;
}
}

0 comments on commit 1e70061

Please sign in to comment.