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