Added ability to export certificate to DER or PEM-formatted file.