如何将ECDiffieHellmanPublicKey实例转换为.net框架中的DER文件?

时间:2018-01-29 18:23:57

标签: c# .net cryptography elliptic-curve der

我有以下代码:

ECDiffieHellman ecdh = ECDiffieHellman.Create(ECCurve.NamedCurves.nistP256);
ECDiffieHellmanPublicKey ecdhPublic = ecdh.PublicKey;

如何将ECDiffieHellmanPublicKey实例(ecdhPublic)导出到DER编码文件中?

1 个答案:

答案 0 :(得分:1)

使用BouncyCastle(http://www.bouncycastle.org/),您可以将ECDH公钥导出为DER编码的ANS.1对象

OFFSET