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')
|
help='Omit key from output')
|
||||||
outputgrp.set_defaults(print_key=True)
|
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',
|
parser.add_argument('x509files',
|
||||||
metavar='x509 file',
|
metavar='x509 file',
|
||||||
nargs='*',
|
nargs='*',
|
||||||
@ -417,12 +421,13 @@ def main():
|
|||||||
logging.info('Subject: %s', x509_subject)
|
logging.info('Subject: %s', x509_subject)
|
||||||
logging.info('Issuer: %s', x509_issuer)
|
logging.info('Issuer: %s', x509_issuer)
|
||||||
|
|
||||||
logging.info(CERTINFO_TEMPLATE.format(
|
if args.informational:
|
||||||
subject=x509_subject,
|
print(CERTINFO_TEMPLATE.format(
|
||||||
issuer=x509_issuer,
|
subject=x509_subject,
|
||||||
notbefore=x509_not_before.strftime(OPENSSLTIME_FMT),
|
issuer=x509_issuer,
|
||||||
notafter=x509_not_after.strftime(OPENSSLTIME_FMT),
|
notbefore=x509_not_before.strftime(OPENSSLTIME_FMT),
|
||||||
sha1fingerprint=x509_object.digest('sha1').decode()))
|
notafter=x509_not_after.strftime(OPENSSLTIME_FMT),
|
||||||
|
sha1fingerprint=x509_object.digest('sha1').decode()))
|
||||||
|
|
||||||
if not args.check:
|
if not args.check:
|
||||||
print(crypto.dump_certificate(crypto.FILETYPE_PEM,
|
print(crypto.dump_certificate(crypto.FILETYPE_PEM,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user