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.

47 lines
912 B

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import os.path
  5. import sqlite3
  6. import subprocess
  7. import json
  8. from paths import *
  9. __doc__= """
  10. Module of classes to handle certificate requests
  11. """
  12. class SignRequest(object):
  13. def __init__(self, req_id):
  14. self.req_id = req_id
  15. def __repr__(self):
  16. return ( "%s %s" % ( str(self.__class__.__name__), str(self.req_id) ) )
  17. def __bool__(self):
  18. return os.path.exists(self.path)
  19. @property
  20. def name(self):
  21. raise NotImplementedError()
  22. @property
  23. def fields(self):
  24. raise NotImplementedError()
  25. @property
  26. def path(self):
  27. return os.path.join(REQUESTS_PATH, self.req_id)
  28. @property
  29. def destination(self):
  30. return os.path.join(OUTPUT_PATH, self.req_id + '.pub')
  31. @property
  32. def fields(self):
  33. return [
  34. ("Hostname", self.host_name)
  35. ]