]> WPIA git - cassiopeia.git/blob - src/sslUtil.h
chg: Build two binaries for the signer
[cassiopeia.git] / src / sslUtil.h
1 #pragma once
2 #include <openssl/ssl.h>
3 #include <memory>
4
5 struct Profile {
6     std::string cert;
7     std::string key;
8     std::string eku;
9     std::string ku;
10
11     std::shared_ptr<X509> ca;
12     std::shared_ptr<EVP_PKEY> caKey;
13 };
14
15 extern std::shared_ptr<int> ssl_lib_ref;
16
17 std::shared_ptr<X509> loadX509FromFile( std::string filename );
18 std::shared_ptr<EVP_PKEY> loadPkeyFromFile( std::string filename );
19
20 std::shared_ptr<SSL_CTX> generateSSLContext( bool server );
21 std::shared_ptr<BIO> openSerial( const char* name );