4#ifndef _Stroika_Foundation_Cryptography_OpenSSL_Certificate_h_
5#define _Stroika_Foundation_Cryptography_OpenSSL_Certificate_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
11#if qStroika_HasComponent_OpenSSL
12#include <openssl/ssl.h>
13#include <openssl/x509.h>
16#include "Stroika/Foundation/Common/Common.h"
17#include "Stroika/Foundation/Cryptography/PKI/Certificate.h"
18#include "Stroika/Foundation/Cryptography/Providers/OpenSSL/PrivateKey.h"
20namespace Stroika::Foundation::Cryptography::Providers::OpenSSL::Certificate {
22 using namespace Cryptography::PKI::Certificate;
24#if qStroika_HasComponent_OpenSSL
27 struct LibRepType : unique_ptr<::X509, decltype (&::X509_free)> {
28 using inherited = unique_ptr<::X509,
decltype (&::X509_free)>;
30 LibRepType (nullptr_t);
31 LibRepType (LibRepType&&) =
default;
37 struct IRep : Cryptography::PKI::Certificate::IRep {
38 virtual X509* Get_X509 ()
const = 0;
43 struct Ptr : shared_ptr<IRep> {
44 using inherited = shared_ptr<IRep>;
50 using inherited::inherited;
51 Ptr (
const shared_ptr<IRep>& p);
52 Ptr (
const shared_ptr<PKI::Certificate::IRep>& p);
56 X509* Get_X509 ()
const;
65 Ptr New (LibRepType&& x509);
66 tuple<OpenSSL::PrivateKey::Ptr, Ptr> New (
const SelfSignedCertParams& params);
76#include "Certificate.inl"