Show some information about the PEM blocks with -i
This commit is contained in:
parent
fe5286b8e5
commit
66f45feea5
@ -289,6 +289,10 @@ def handle_args():
|
||||
help='Omit key from output')
|
||||
outputgrp.set_defaults(print_key=True)
|
||||
|
||||
parser.add_argument('-i', '--informational',
|
||||
action='store_true',
|
||||
help='Show some information about the PEM blocks')
|
||||
|
||||
parser.add_argument('x509files',
|
||||
metavar='x509 file',
|
||||
nargs='*',
|
||||
@ -417,12 +421,13 @@ def main():
|
||||
logging.info('Subject: %s', x509_subject)
|
||||
logging.info('Issuer: %s', x509_issuer)
|
||||
|
||||
logging.info(CERTINFO_TEMPLATE.format(
|
||||
subject=x509_subject,
|
||||
issuer=x509_issuer,
|
||||
notbefore=x509_not_before.strftime(OPENSSLTIME_FMT),
|
||||
notafter=x509_not_after.strftime(OPENSSLTIME_FMT),
|
||||
sha1fingerprint=x509_object.digest('sha1').decode()))
|
||||
if args.informational:
|
||||
print(CERTINFO_TEMPLATE.format(
|
||||
subject=x509_subject,
|
||||
issuer=x509_issuer,
|
||||
notbefore=x509_not_before.strftime(OPENSSLTIME_FMT),
|
||||
notafter=x509_not_after.strftime(OPENSSLTIME_FMT),
|
||||
sha1fingerprint=x509_object.digest('sha1').decode()))
|
||||
|
||||
if not args.check:
|
||||
print(crypto.dump_certificate(crypto.FILETYPE_PEM,
|
||||
|
Loading…
x
Reference in New Issue
Block a user