martinpaljak/M2Crypto — pull request #53 by qtip (2014-10-25 15:09:44+00:00)
Title: DH: Add as_pem method to DH class

- Add dh_write_params to swig interface to write pem file to BIO
- Add as_pem method to DH class to return a pem-formatted string
representation of the DH params.

My goal is to emulate the openssl cli command:

openssl dhparam -out dhparams.pem 2048

I used the source code from openssl's dhparam app as my guide for this
commit.
See https://github.com/openssl/openssl/blob/master/apps/dhparam.c for
details.