I am facing one silly issue in storing my DH Keys in PEM Format. Here is working code snippet to generate Keys in Diffie Hellman format, I can store the DH Params in PEM Format.