SneakPeak

Look and feel

Help Menu
python3 ./main.py --help                                                       
usage: main.py [-h] [-n NUMBER] [--checktype] [--checkchain] [--checkchaincomplex] [--noout] [--issuer] [--subject] [--printall] [--extensions] [--export] [--filename] file
positional arguments:
  file                 input file
options:
  -h, --help           show this help message and exit
  -n, --number NUMBER  Number of certificate
  --checktype          Gives PEM Type. Root CA, Intermediate CA or Certificate.
  --checkchain         Checks if file contains full chain and lists her.
  --checkchaincomplex  Checks if file contains full chain and lists her.
  --noout              If the certificate is meant to be printed out.
  --issuer             If the x509 issuer is meant to be printed out.
  --subject            If the x509 issuer is meant to be printed out.
  --printall           Prints subject and issuer for all certs in chain.
  --extensions         Prints certficates extensions.
  --export             Export the certificate selected with flag -n.
  --filename           Filename when exporting a single certificate. Without path will be saved to same dir as inputfile. Explicit paths are taken into account.
Print all contained information in a short manner
python3 ./main.py ../test-files/client1-fullchain.pem --noout --printall
Certificate 1
Issuer: /C=DE/ST=Hamburg/L=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort root CA/emailAddress=certsort@mailbox.org
Subject: /C=DE/ST=Hamburg/L=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort root CA/emailAddress=certsort@mailbox.org
Type: Root CA.

Certificate 2
Issuer: /C=DE/ST=Hamburg/L=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort root CA/emailAddress=certsort@mailbox.org
Subject: /C=DE/ST=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort intermediate CA/emailAddress=certsort@mailbox.org
Type: Intermediate CA.

Certificate 3
Issuer: /C=DE/ST=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort intermediate CA/emailAddress=certsort@mailbox.org
Subject: /C=DE/ST=Hamburg/L=Hamburg/O=certsort project/OU=certsort project testing/CN=certsort client 1/emailAddress=certsort@mailbox.org
Type: Certificate.
Check for contained chains
python3 ./main.py ../test-files/client1-fullchain.pem --noout --checkchain

Found CA = Root CA; Found at position = 1
/C=DE/ST=Hamburg/L=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort root CA/emailAddress=certsort@mailbox.org
/C=DE/ST=Hamburg/L=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort root CA/emailAddress=certsort@mailbox.org

Found Intermediate CA = Intermediate CA; Found at position = 2
/C=DE/ST=Hamburg/L=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort root CA/emailAddress=certsort@mailbox.org
/C=DE/ST=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort intermediate CA/emailAddress=certsort@mailbox.org

Found Certificate = Certificate; Found at position = 3
/C=DE/ST=Hamburg/O=certsort project/OU=certsort project certificate authority/CN=certsort intermediate CA/emailAddress=certsort@mailbox.org
/C=DE/ST=Hamburg/L=Hamburg/O=certsort project/OU=certsort project testing/CN=certsort client 1/emailAddress=certsort@mailbox.org

Found full chain. Return value == True
Show a single cerfiticates extensions
python3 ./main.py ../test-files/client1-fullchain.pem --noout -n2 --extensions

Key                    | Value                                                    
-----------------------+------------------------------------------------------------
subjectKeyIdentifier   | 72:2A:A9:43:98:53:86:DF:E4:A1:65:DC:8E:D0:06:2F:28:07:AC:98
authorityKeyIdentifier | FF:AF:C7:E7:C3:8B:C9:5E:69:19:6B:4C:58:C0:E1:4D:08:11:B9:C9
basicConstraints       | CA:TRUE, pathlen:0                                        
keyUsage               | Digital Signature, Certificate Sign, CRL Sign            

python3 ./main.py ../test-files/client1-fullchain.pem --noout -n3 --extensions
Key                    | Value                                                    
-----------------------+------------------------------------------------------------
basicConstraints       | CA:FALSE                                                  
nsCertType             | SSL Client, S/MIME                                        
nsComment              | OpenSSL Generated Client Certificate                      
subjectKeyIdentifier   | 84:EF:14:EF:2E:0E:D5:2B:73:1B:FA:B1:90:A8:BD:FF:9F:74:C4:24
authorityKeyIdentifier | 72:2A:A9:43:98:53:86:DF:E4:A1:65:DC:8E:D0:06:2F:28:07:AC:98
keyUsage               | Digital Signature, Non Repudiation, Key Encipherment      
extendedKeyUsage       | TLS Web Client Authentication, E-mail Protection
Show a single certificates type
python3 ./main.py ../test-files/client1-fullchain.pem --noout -n2 --checktype
PEM is a Intermediate CA.

python3 ./main.py ../test-files/client1-fullchain.pem --noout -n3 --checktype
PEM is a certificate.