Skip to content

Commit 0692a71

Browse files
committed
Merge branch 'fedelippo-master'
2 parents f5078e4 + 482551b commit 0692a71

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

crypto/src/crypto/parameters/RsaPrivateCrtKeyParameters.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
using Org.BouncyCastle.Crypto;
44
using Org.BouncyCastle.Math;
5+
using Org.BouncyCastle.Asn1.Pkcs;
56

67
namespace Org.BouncyCastle.Crypto.Parameters
78
{
@@ -36,7 +37,20 @@ public RsaPrivateCrtKeyParameters(
3637
this.qInv = qInv;
3738
}
3839

39-
public BigInteger PublicExponent
40+
public RsaPrivateCrtKeyParameters(RsaPrivateKeyStructure rsaPrivateKey)
41+
: this(
42+
rsaPrivateKey.Modulus,
43+
rsaPrivateKey.PublicExponent,
44+
rsaPrivateKey.PrivateExponent,
45+
rsaPrivateKey.Prime1,
46+
rsaPrivateKey.Prime2,
47+
rsaPrivateKey.Exponent1,
48+
rsaPrivateKey.Exponent2,
49+
rsaPrivateKey.Coefficient
50+
)
51+
{ }
52+
53+
public BigInteger PublicExponent
4054
{
4155
get { return e; }
4256
}

0 commit comments

Comments
 (0)