summary refs log tree commit diff
path: root/crypto/src/x509/SubjectPublicKeyInfoFactory.cs
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/x509/SubjectPublicKeyInfoFactory.cs
parentEnv. prop.: Org.BouncyCastle.Asn1.AllowUnsafeInteger (diff)
downloadBouncyCastle.NET-ed25519-e8c09187bd814f71d502955e340d06a979619748.tar.xz
Include public key in EC encoding
Diffstat (limited to 'crypto/src/x509/SubjectPublicKeyInfoFactory.cs')
-rw-r--r--crypto/src/x509/SubjectPublicKeyInfoFactory.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/src/x509/SubjectPublicKeyInfoFactory.cs b/crypto/src/x509/SubjectPublicKeyInfoFactory.cs
index fca5da3f5..2fa8b7a28 100644
--- a/crypto/src/x509/SubjectPublicKeyInfoFactory.cs
+++ b/crypto/src/x509/SubjectPublicKeyInfoFactory.cs
@@ -131,12 +131,12 @@ namespace Org.BouncyCastle.X509
                         x962 = new X962Parameters(_key.PublicKeyParamSet);
                     }
 
-                    Asn1OctetString p = (Asn1OctetString)(new X9ECPoint(_key.Q).ToAsn1Object());
+                    byte[] pubKey = _key.Q.GetEncoded(false);
 
                     AlgorithmIdentifier algID = new AlgorithmIdentifier(
                         X9ObjectIdentifiers.IdECPublicKey, x962.ToAsn1Object());
 
-                    return new SubjectPublicKeyInfo(algID, p.GetOctets());
+                    return new SubjectPublicKeyInfo(algID, pubKey);
                 }
             } // End of EC