Skip to content

Instantly share code, notes, and snippets.

View jonlundy's full-sized avatar
🚀
Awesome

Jon Lundy jonlundy

🚀
Awesome
View GitHub Profile
@ivanov17
ivanov17 / jwk2asn1.py
Last active June 12, 2023 07:51 — forked from jonlundy/conv.py
Convert the Letsencrypt/Certbot private_key.json file to Abstract Syntax Notation One (ASN.1)
#!/usr/bin/env python3
# Convert certbot private_key.json to Abstract Syntax Notation One (ASN.1)
# Usage: python3 jwk2asn1.py private_key.json > private_key.asn1
# openssl asn1parse -genconf private_key.asn1 -noout -out private_key.der
# openssl rsa -in private_key.der -inform der > private_key.pem
#
# Originally developed and published by Jon Lundy under the MIT License, 2015
# Updated to Python 3.6 by Anton Ivanov, Agorist International Conspiracy, 2020
#
from sys import argv