Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beautify the verifier output and add an entry_point #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

i3visio
Copy link

@i3visio i3visio commented Jan 16, 2018

The output has been beautified and some information about the Json is also displayed in the terminal. With the entry_point set in setup.py users of the library will also be able to launch the verifier using verify-certificate. The output of a sample test would look like the following:

$ verify-certificate -c cert1.json cert2.json 
[*] Certificate #1 | Verifying 'cert1.json'.
[*] Issuer data:
	Name:		University of Learning
	Email:		[email protected]
	Public key:	ecdsa-koblitz-pubkey:msBCHdwaQ7N2ypBYupkp6uNxtr9Pg76imj
[*] Recipient data:
	Name:		Eularia Landroth
	Email:		[email protected]
	Public key:	ecdsa-koblitz-pubkey:mtr98kany9G1XYNU74pRnfBQmaCg2FZLmc
[*] Certificate data:
	Name:		Certificate of Accomplishment
	Description:	Lorem ipsum dolor sit amet, mei docendi concludaturque ad, cu nec partem graece. Est aperiam consetetur cu, expetenda moderatius neglegentur ei nam, suas dolor laudem eam an.
	Criteria:	Nibh iriure ei nam, modo ridens neglegentur mel eu. At his cibo mucius.
	Issued on:	2017-06-29T14:58:57.461422+00:00
[*] Verification steps:
	Step #1. Checking certificate has not been tampered with --> passed
	Step #2. Checking certificate has not expired --> passed
	Step #3. Checking not revoked by issuer --> passed
	Step #4. Checking authenticity --> passed
	Step #5. Validation --> passed

[*] Certificate #2 | Verifying 'cert2.json'.
[*] Issuer data:
	Name:		University of Learning
	Email:		[email protected]
	Public key:	ecdsa-koblitz-pubkey:msBCHdwaQ7N2ypBYupkp6uNxtr9Pg76imj
[*] Recipient data:
	Name:		Eularia Landroth
	Email:		[email protected]
	Public key:	ecdsa-koblitz-pubkey:mtr98kany9G1XYNU74pRnfBQmaCg2FZLmc
[*] Certificate data:
	Name:		Certificate of Accomplishment
	Description:	Lorem ipsum dolor sit amet, mei docendi concludaturque ad, cu nec partem graece. Est aperiam consetetur cu, expetenda moderatius neglegentur ei nam, suas dolor laudem eam an.
	Criteria:	Nibh iriure ei nam, modo ridens neglegentur mel eu. At his cibo mucius.
	Issued on:	2017-06-29T14:58:57.461422+00:00
[*] Verification steps:
	Step #1. Checking certificate has not been tampered with --> passed
	Step #2. Checking certificate has not expired --> passed
	Step #3. Checking not revoked by issuer --> passed
	Step #4. Checking authenticity --> passed
	Step #5. Validation --> passed

[*] Verification summary:
{
  "cert2.json": [
    {
      "name": "Checking certificate has not been tampered with",
      "status": "passed"
    },
    {
      "name": "Checking certificate has not expired",
      "status": "passed"
    },
    {
      "name": "Checking not revoked by issuer",
      "status": "passed"
    },
    {
      "name": "Checking authenticity",
      "status": "passed"
    },
    {
      "name": "Validation",
      "status": "passed"
    }
  ],
  "cert1.json": [
    {
      "name": "Checking certificate has not been tampered with",
      "status": "passed"
    },
    {
      "name": "Checking certificate has not expired",
      "status": "passed"
    },
    {
      "name": "Checking not revoked by issuer",
      "status": "passed"
    },
    {
      "name": "Checking authenticity",
      "status": "passed"
    },
    {
      "name": "Validation",
      "status": "passed"
    }
  ]
}

Some changes have done:
- Add argparse for options parsing
- Print information about each certificate before verifying it.
- Beautify the output of the information shown
- Print the summary of the results Json indented
@kimdhamilton
Copy link
Member

Thank you so much for this wonderful change, @i3visio! I noticed travis is failing. I'll check to see the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants