MCPcopy Index your code
hub / github.com/zappa/Zappa / encode_certificate

Function encode_certificate

zappa/letsencrypt.py:369–379  ·  view source on GitHub ↗

Encode cert bytes to PEM encoded cert file.

(result)

Source from the content-addressed store, hash-verified

367
368
369def encode_certificate(result):
370 """
371 Encode cert bytes to PEM encoded cert file.
372 """
373 cert_body = """-----BEGIN CERTIFICATE-----\n{0}\n-----END CERTIFICATE-----\n""".format(
374 "\n".join(textwrap.wrap(base64.b64encode(result).decode("utf8"), 64))
375 )
376 with open("{}/signed.crt".format(gettempdir()), "w") as signed_crt:
377 signed_crt.write(cert_body)
378
379 return True
380
381
382##

Callers 2

get_certFunction · 0.85

Calls 1

gettempdirFunction · 0.85

Tested by 1