8 #include <openssl/ssl.h>
10 #include "db/database.h"
17 std::shared_ptr<X509> ca;
18 std::shared_ptr<EVP_PKEY> caKey;
19 std::shared_ptr<ASN1_TIME> notBefore;
20 CAConfig( std::string name );
29 std::vector<std::shared_ptr<CAConfig>> ca;
30 std::shared_ptr<CAConfig> getCA() {
31 for( auto it = ca.rbegin(); it != ca.rend(); it++ ) {
32 if( X509_cmp_current_time( ( *it )->notBefore.get() ) < 0 ) {
41 extern std::shared_ptr<int> ssl_lib_ref;
43 std::shared_ptr<X509> loadX509FromFile( std::string filename );
44 std::shared_ptr<EVP_PKEY> loadPkeyFromFile( std::string filename );
46 std::shared_ptr<SSL_CTX> generateSSLContext( bool server );
47 std::shared_ptr<BIO> openSerial( const std::string name );
48 std::string timeToString( std::shared_ptr<ASN1_TIME> time );
49 void extractTimes( std::shared_ptr<X509> source, std::shared_ptr<SignedCertificate> cert );