Skip to content

Instantly share code, notes, and snippets.

@WinLinux1028
Last active October 14, 2024 19:56
Show Gist options
  • Save WinLinux1028/6debd8a7a316a19f81675c250fdbfd44 to your computer and use it in GitHub Desktop.
Save WinLinux1028/6debd8a7a316a19f81675c250fdbfd44 to your computer and use it in GitHub Desktop.
RFC4398 IPGP certificate generator
import sys
import base64
args = sys.argv
if len(args) != 4 or "--help" in args or "-h" in args:
print("./" + args[0] + " " + "FINGERPRINT URL EMAIL_ADDRESS")
sys.exit()
f = bytes.fromhex(args[1])
url = args[2].encode()
email = args[3]
cert = base64.b64encode(len(f).to_bytes() + f + url).decode()
domain = email.replace("@", ".") + "."
print(domain + " 3600 IN CERT 6 0 0 " + cert)
@WinLinux1028
Copy link
Author

You can test DNS CERT record by this command.
gpg -v --debug-level guru --debug-all --auto-key-locate cert --locate-external-keys EMAIL_ADDRESS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment