Message303505
Current DER_cert_to_PEM_cert() uses textwrap like this:
def DER_cert_to_PEM_cert(der_cert_bytes):
"""Takes a certificate in binary DER format and returns the
PEM version of it as a string."""
f = str(base64.standard_b64encode(der_cert_bytes), 'ASCII', 'strict')
return (PEM_HEADER + '\n' +
textwrap.fill(f, 64) + '\n' +
PEM_FOOTER + '\n')
But textwrap is designed to break lines at word boundary.
So textwrap.fill for base64 text may be slow.
And `import textwrap` is little slow too.
We can use simple slicing instead of textwrap. |
|
Date |
User |
Action |
Args |
2017-10-02 00:47:35 | methane | set | recipients:
+ methane |
2017-10-02 00:47:34 | methane | set | messageid: <1506905254.99.0.213398074469.issue31659@psf.upfronthosting.co.za> |
2017-10-02 00:47:34 | methane | link | issue31659 messages |
2017-10-02 00:47:33 | methane | create | |
|