Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
SSL/ServerContext.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Cryptography_SSL_ServerContext_h_
5#define _Stroika_Foundation_Cryptography_SSL_ServerContext_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <memory>
10
11#include "Stroika/Foundation/Common/Common.h"
12#include "Stroika/Foundation/Cryptography/PKI/Certificate.h"
13#include "Stroika/Foundation/Cryptography/PKI/PrivateKey.h"
14#include "Stroika/Foundation/Cryptography/SSL/Common.h"
15
16namespace Stroika::Foundation::Cryptography::SSL::ServerContext {
17
18 /**
19 */
20 class IRep {
21 public:
22 virtual ~IRep () = default;
23 };
24
25 /**
26 * \note Design Note:
27 * Could have had get/set properties on IRep, or passed in Options. The former a bit more flexible
28 * but that flexibility rarely (never) used, so go with simpler API, which may be easier to adapt to
29 * different backend ssl implementations (and simpler threading implications).
30 */
31 struct Options {
32 // @todo typical args here are -METHOD : SSL-VERSION (TLS1.3, etc) - CERT, and PRIVATE KEY
33
34 /**
35 * To server SSL, need both private key and public CERT
36 */
37 tuple<PKI::PrivateKey::Ptr, PKI::Certificate::Ptr> fCertificate;
38 };
39
40 /**
41 */
42 struct Ptr : shared_ptr<IRep> {
43 using inherited = shared_ptr<IRep>;
44 /**
45 * inherit all CTORS from base
46 */
47 using inherited::inherited;
48 };
49
50 Ptr New (const Options& o);
51
52}
53
54/*
55 ********************************************************************************
56 ***************************** Implementation Details ***************************
57 ********************************************************************************
58 */
59#endif /*_Stroika_Foundation_Cryptography_SSL_ServerContext_h_*/
tuple< PKI::PrivateKey::Ptr, PKI::Certificate::Ptr > fCertificate