Easy CA management
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

37 lines
718 B

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from peewee import *
import os
import os.path
from paths import *
__doc__= """
Module of classes to handle certificate requests
"""
class Authority(Model):
request_allowed = []
# data stored in the database
ca_id = CharField()
name = CharField()
serial = IntegerField()
def __bool__(self):
return os.path.exists(self.path)
@property
def path(self):
return os.path.join(self.ca_dir, self.ca_id)
def generate(self):
raise NotImplementedError()
def sign(self, request):
raise NotImplementedError()
def __repr__(self):
return ( "%s %s" % ( self.__class__.__name__, self.ca_id ) )