]> WPIA git - cassiopeia.git/blob - src/crypto/remoteSigner.h
add: Initial code to implement revocation
[cassiopeia.git] / src / crypto / remoteSigner.h
1 #pragma once
2 #include <memory>
3 #include <openssl/ssl.h>
4
5 #include "db/database.h"
6 #include "crypto/signer.h"
7 #include "io/bios.h"
8 #include "io/opensslBIO.h"
9 #include "io/record.h"
10
11
12 class RemoteSigner : public Signer {
13 private:
14     std::shared_ptr<BIO> target;
15     std::shared_ptr<SSL_CTX> ctx;
16     std::shared_ptr<std::ostream> log;
17     int count = 0;
18     void send( std::shared_ptr<OpensslBIOWrapper> bio, RecordHeader& head, RecordHeader::SignerCommand cmd, std::string data );
19 public:
20     RemoteSigner( std::shared_ptr<BIO> target, std::shared_ptr<SSL_CTX> ctx );
21     ~RemoteSigner();
22     std::shared_ptr<SignedCertificate> sign( std::shared_ptr<TBSCertificate> cert );
23     std::shared_ptr<X509_CRL> revoke( std::shared_ptr<CAConfig> ca, std::string serial );
24
25     void setLog( std::shared_ptr<std::ostream> target );
26 };