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

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. from peewee import *
  4. import os
  5. import os.path
  6. from paths import *
  7. __doc__= """
  8. Module of classes to handle certificate requests
  9. """
  10. class Authority(Model):
  11. request_allowed = []
  12. # data stored in the database
  13. ca_id = CharField()
  14. name = CharField()
  15. serial = IntegerField()
  16. def __bool__(self):
  17. return os.path.exists(self.path)
  18. @property
  19. def path(self):
  20. return os.path.join(self.ca_dir, self.ca_id)
  21. def generate(self):
  22. raise NotImplementedError()
  23. def sign(self, request):
  24. raise NotImplementedError()
  25. def __repr__(self):
  26. return ( "%s %s" % ( self.__class__.__name__, self.ca_id ) )