Add x509_write_cert_pem which writes the cert->raw into a buffer in PEM format.