Coverage for jbank/management/commands/parse_x509.py: 0%

1 import logging

2 from pprint import pprint

3 from django.core.management.base import CommandParser

4 from jbank.x509_helpers import get_x509_cert_from_file

5 from jutil.command import SafeCommand

6

7

8 logger = logging.getLogger(__name__)

9

10

11 class Command(SafeCommand):

12 help = "Parses x509 cert"

13

14 def add_arguments(self, parser: CommandParser):

15 parser.add_argument("pem", type=str)

16

17 def do(self, *args, **options):

18 cert = get_x509_cert_from_file(options["pem"])

19 pprint(cert)