summary refs log tree commit diff
path: root/crypto
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2018-10-08 21:14:18 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2018-10-08 21:14:18 +0700
commit482551bfc6d6534a218b1ac44076aabb65d25b85 (patch)
treedd0d05470baa8c9ecf9d19468651127d40a02111 /crypto
parentRFC 7748: Exclude all-zeroes agreement value (diff)
parentAdd a new constructor which accepts RsaPrivateKeyStructure (diff)
downloadBouncyCastle.NET-ed25519-482551bfc6d6534a218b1ac44076aabb65d25b85.tar.xz
Merge branch 'master' of https://github.com/fedelippo/bc-csharp into fedelippo-master
Diffstat (limited to 'crypto')
-rw-r--r--crypto/src/crypto/parameters/RsaPrivateCrtKeyParameters.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/crypto/src/crypto/parameters/RsaPrivateCrtKeyParameters.cs b/crypto/src/crypto/parameters/RsaPrivateCrtKeyParameters.cs
index 7bd8abd76..e5ed0a8b6 100644
--- a/crypto/src/crypto/parameters/RsaPrivateCrtKeyParameters.cs
+++ b/crypto/src/crypto/parameters/RsaPrivateCrtKeyParameters.cs
@@ -2,6 +2,7 @@ using System;
 
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Math;
+using Org.BouncyCastle.Asn1.Pkcs;
 
 namespace Org.BouncyCastle.Crypto.Parameters
 {
@@ -36,7 +37,20 @@ namespace Org.BouncyCastle.Crypto.Parameters
             this.qInv = qInv;
         }
 
-		public BigInteger PublicExponent
+    public RsaPrivateCrtKeyParameters(RsaPrivateKeyStructure rsaPrivateKey)
+     : this(
+      rsaPrivateKey.Modulus,
+      rsaPrivateKey.PublicExponent,
+      rsaPrivateKey.PrivateExponent,
+      rsaPrivateKey.Prime1,
+      rsaPrivateKey.Prime2,
+      rsaPrivateKey.Exponent1,
+      rsaPrivateKey.Exponent2,
+      rsaPrivateKey.Coefficient
+      )
+    { }
+
+    public BigInteger PublicExponent
         {
             get { return e; }
 		}