How can I achieve the same result in C with OpenSSL as the getEncoded() Method produces? It is required for a Diffie-Hellman Key Agreement and I have to send my public key to a java server (But I think the getEncoded() Method not only encodes the Public Key but also the parameters which should be also required for my case)

My current status is that I have a OpenSSL DH Object which contains the PublicKey and p&g as BigNums.

Would bey very great if anyone knows how to do that.

有帮助吗?

解决方案

If encoded DH object means DER encoded, then i2d_DHParams can help you. It is given here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top