Last active
January 4, 2023 19:40
-
-
Save jlamimoso/10b99c232eed979130c97c041a1402b6 to your computer and use it in GitHub Desktop.
Python program that reads SSH certificate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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