]> WPIA git - cassiopeia.git/blobdiff - src/database.h
add: simple, signer-side record handling
[cassiopeia.git] / src / database.h
index a80b73ed69f2703f9292329d90dd9a068f4b9ab8..081e925651e0325c0798ac2a623991a04d55d1ce 100644 (file)
@@ -4,6 +4,11 @@
 #include <memory>
 #include <vector>
 
+struct Profile {
+    std::string cert;
+    std::string key;
+};
+
 struct Job {
     std::string id;
     std::string target;
@@ -17,15 +22,34 @@ struct SAN {
     std::string type;
 };
 
+struct AVA {
+    std::string name;
+    std::string value;
+};
+
 struct TBSCertificate {
-    std::string CN;
-    std::string subj;
     std::string md;
     std::string profile;
+    /**
+     * CSR path
+     */
     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;
+    std::string log;
 };
 
 class JobProvider {
@@ -33,4 +57,5 @@ 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;
 };