summary refs log tree commit diff
path: root/crypto/src/asn1
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2018-10-22 11:45:50 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2018-10-22 11:45:50 +0700
commite8c09187bd814f71d502955e340d06a979619748 (patch)
treec5a52ab13e5473705f79a3b05502a38653edb8f1 /crypto/src/asn1
parentEnv. prop.: Org.BouncyCastle.Asn1.AllowUnsafeInteger (diff)
downloadBouncyCastle.NET-ed25519-e8c09187bd814f71d502955e340d06a979619748.tar.xz
Include public key in EC encoding
Diffstat (limited to 'crypto/src/asn1')
-rw-r--r--crypto/src/asn1/sec/ECPrivateKeyStructure.cs11
1 files changed, 1 insertions, 10 deletions
diff --git a/crypto/src/asn1/sec/ECPrivateKeyStructure.cs b/crypto/src/asn1/sec/ECPrivateKeyStructure.cs
index 32e020c0b..aec8e0af0 100644
--- a/crypto/src/asn1/sec/ECPrivateKeyStructure.cs
+++ b/crypto/src/asn1/sec/ECPrivateKeyStructure.cs
@@ -48,17 +48,8 @@ namespace Org.BouncyCastle.Asn1.Sec
         public ECPrivateKeyStructure(
             int         orderBitLength,
             BigInteger  key)
+            : this(orderBitLength, key, null)
         {
-            if (key == null)
-                throw new ArgumentNullException("key");
-            if (orderBitLength < key.BitLength)
-                throw new ArgumentException("must be >= key bitlength", "orderBitLength");
-
-            byte[] bytes = BigIntegers.AsUnsignedByteArray((orderBitLength + 7) / 8, key);
-
-            this.seq = new DerSequence(
-                new DerInteger(1),
-                new DerOctetString(bytes));
         }
 
         [Obsolete("Use constructor which takes 'orderBitLength' instead, to guarantee correct encoding")]