diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2018-10-22 11:45:50 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2018-10-22 11:45:50 +0700 |
commit | e8c09187bd814f71d502955e340d06a979619748 (patch) | |
tree | c5a52ab13e5473705f79a3b05502a38653edb8f1 /crypto/src/x509 | |
parent | Env. prop.: Org.BouncyCastle.Asn1.AllowUnsafeInteger (diff) | |
download | BouncyCastle.NET-ed25519-e8c09187bd814f71d502955e340d06a979619748.tar.xz |
Include public key in EC encoding
Diffstat (limited to 'crypto/src/x509')
-rw-r--r-- | crypto/src/x509/SubjectPublicKeyInfoFactory.cs | 4 |
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 |