Skip to content

Instantly share code, notes, and snippets.

View mt-kelvintaywl's full-sized avatar

Kelvin Tay mt-kelvintaywl

  • tokyo
View GitHub Profile
@mt-kelvintaywl
mt-kelvintaywl / motivation.md
Last active December 10, 2020 16:27
Messing around with Glue
@mt-kelvintaywl
mt-kelvintaywl / pem_key.py
Last active February 18, 2020 23:22
generate PEM cert from DER string
cert = 'your DER string here'
headers = [
'-----BEGIN CERTIFICATE-----',
'-----END CERTIFICATE-----'
]
formatted = '\n'.join([headers[0]] + [cert[i:i+64] for i in range(0, len(cert), 64)] +[headers[1]])
print(formatted)
# alternatively, pipe this content to a .pem file