]> WPIA git - cassiopeia.git/blobdiff - src/database.h
Merge branch 'libs/openssl/local'
[cassiopeia.git] / src / database.h
index b189807107c64df830378821c8927bb4d80fe988..b438187d8be3b66c1df7a3afb68fa3b4924556a1 100644 (file)
@@ -2,16 +2,56 @@
 
 #include <string>
 #include <memory>
+#include <vector>
+
+struct Profile {
+    std::string cert;
+    std::string key;
+};
 
 struct Job {
     std::string id;
+    std::string target;
     std::string task;
     std::string from;
     std::string to;
 };
 
+struct SAN {
+    std::string content;
+    std::string type;
+};
+
+struct AVA {
+    std::string name;
+    std::string value;
+};
+
+struct TBSCertificate {
+    std::string md;
+    std::string profile;
+    std::string csr;
+    std::string csr_type;
+    std::string csr_content;
+    std::vector<std::shared_ptr<SAN>> SANs;
+    std::vector<std::shared_ptr<AVA>> AVAs;
+};
+
+
+struct SignedCertificate {
+    std::string certificate;
+    std::string serial;
+    uint32_t before;
+    uint32_t after;
+    std::string pkHash;
+    std::string certHash;
+    std::string crt_name;
+};
+
 class JobProvider {
 public:
     virtual std::shared_ptr<Job> fetchJob() = 0;
     virtual bool finishJob( std::shared_ptr<Job> job ) = 0;
+    virtual std::shared_ptr<TBSCertificate> fetchTBSCert( std::shared_ptr<Job> job ) = 0;
+    virtual void writeBack( std::shared_ptr<Job> job, std::shared_ptr<SignedCertificate> res ) = 0;
 };