9 #include <openssl/ssl.h>
11 #include "db/database.h"
17 std::shared_ptr<X509> ca;
18 std::shared_ptr<EVP_PKEY> caKey;
19 std::shared_ptr<ASN1_TIME> notBefore;
21 CAConfig( const std::string& name );
23 bool crlNeedsResign();
32 std::vector<std::shared_ptr<CAConfig>> ca;
33 std::time_t maxValidity;
34 std::shared_ptr<CAConfig> getCA() {
35 for( auto it = ca.rbegin(); it != ca.rend(); it++ ) {
36 if( X509_cmp_current_time( ( *it )->notBefore.get() ) < 0 ) {
45 extern std::shared_ptr<int> ssl_lib_ref;
47 std::shared_ptr<X509> loadX509FromFile( const std::string& filename );
48 std::shared_ptr<EVP_PKEY> loadPkeyFromFile( const std::string& filename );
50 std::shared_ptr<SSL_CTX> generateSSLContext( bool server );
51 std::shared_ptr<BIO> openSerial( const std::string& name );
52 std::string timeToString( std::shared_ptr<ASN1_TIME> time );
54 void extractTimes( std::shared_ptr<X509> source, std::shared_ptr<SignedCertificate> cert );