]> WPIA git - cassiopeia.git/blob - src/database.h
add: Add support for Subject Alternative Names (SANs)
[cassiopeia.git] / src / database.h
1 #pragma once
2
3 #include <string>
4 #include <memory>
5 #include <vector>
6
7 struct Job {
8     std::string id;
9     std::string target;
10     std::string task;
11     std::string from;
12     std::string to;
13 };
14
15 struct SAN {
16     std::string content;
17     std::string type;
18 };
19
20 struct TBSCertificate {
21     std::string CN;
22     std::string subj;
23     std::string md;
24     std::string profile;
25     std::string csr;
26     std::string csr_type;
27     std::string csr_content;
28     std::vector<std::shared_ptr<SAN>> SANs;
29 };
30
31 class JobProvider {
32 public:
33     virtual std::shared_ptr<Job> fetchJob() = 0;
34     virtual bool finishJob( std::shared_ptr<Job> job ) = 0;
35     virtual std::shared_ptr<TBSCertificate> fetchTBSCert( std::shared_ptr<Job> job ) = 0;
36 };