Skip to content

Instantly share code, notes, and snippets.

@jlamimoso
Last active January 4, 2023 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlamimoso/10b99c232eed979130c97c041a1402b6 to your computer and use it in GitHub Desktop.
Save jlamimoso/10b99c232eed979130c97c041a1402b6 to your computer and use it in GitHub Desktop.
Python program that reads SSH certificate
import traceback
from ssh_certificate_parser import SSHCertificate
try:
cert = SSHCertificate.from_file('./id_rsa-cert.pub')
print("valid_after : %s" % (cert.valid_after));
print("valid_before : %s" % (cert.valid_before));
print("remaining_validity: %s" % (cert.remaining_validity));
except Exception as ex:
print("cert inválido ")
traceback.print_exception(ex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment