From 1113585e72efded9e0e63a2a0f5bd15b5e8df8ca Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Sat, 29 Oct 2016 00:28:11 +0200 Subject: [PATCH] draft for certificate object management --- certificate.py | 22 ++++++++++++++++++++++ lookup.py | 1 + 2 files changed, 23 insertions(+) create mode 100755 certificate.py diff --git a/certificate.py b/certificate.py new file mode 100755 index 0000000..b03b206 --- /dev/null +++ b/certificate.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import os +import json + +from paths import * + +__doc__= """ +Module of classes to handle certificate requests +""" + +class Certificate(object): + def __init__(self, cert_id): + self.cert_id = cert_id + + def __repr__(self): + return ( "%s %s" % ( str(self.__class__.__name__), str(self.cert_id) ) ) + + @property + def path(self): + return os.path.join(OUTPUT_PATH, self.cert_id + '-cert.pub') diff --git a/lookup.py b/lookup.py index 0dedac2..5f543d6 100755 --- a/lookup.py +++ b/lookup.py @@ -11,6 +11,7 @@ import sqlite3 import tempfile from authority import * +from certificate import * from request import * from paths import *