@staticmethod<EOL><INDENT>def format_cert(cert, heads=True):<DEDENT>
x509_cert = cert.replace('<STR_LIT>', '<STR_LIT>')<EOL>x509_cert = x509_cert.replace('<STR_LIT:\r>', '<STR_LIT>')<EOL>x509_cert = x509_cert.replace('<STR_LIT:\n>', '<STR_LIT>')<EOL>if len(x509_cert) > <NUM_LIT:0>:<EOL><INDENT>x509_cert = x509_cert.replace('<STR_LIT>', '<STR_LIT>')<EOL>x509_cert = x509_cert.replace('<STR_LIT>', '<STR_LIT>')<EOL>x509_cert = x509_cert.replace('<STR_LIT:U+0020>', '<STR_LIT>')<EOL>if heads:<EOL><INDENT>x509_cert = "<STR_LIT>" + "<STR_LIT:\n>".join(wrap(x509_cert, <NUM_LIT:64>)) + "<STR_LIT>"<EOL><DEDENT><DEDENT>return x509_cert<EOL>
Returns a x509 cert (adding header & footer if required).

:param cert: A x509 unformatted cert
:type: string

:param heads: True if we want to include head and footer
:type: boolean

:returns: Formatted cert
:rtype: string