4#ifndef _Stroika_Foundation_Cryptography_OpenSSL_PrivateKey_h_
5#define _Stroika_Foundation_Cryptography_OpenSSL_PrivateKey_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
11#if qStroika_HasComponent_OpenSSL
12#include <openssl/evp.h>
15#include "Stroika/Foundation/Common/Common.h"
16#include "Stroika/Foundation/Cryptography/PKI/PrivateKey.h"
18namespace Stroika::Foundation::Cryptography::Providers::OpenSSL::PrivateKey {
20#if qStroika_HasComponent_OpenSSL
23 struct LibRepType : unique_ptr<::EVP_PKEY, decltype (&::EVP_PKEY_free)> {
24 using inherited = unique_ptr<::EVP_PKEY,
decltype (&::EVP_PKEY_free)>;
26 LibRepType (nullptr_t);
27 LibRepType (LibRepType&&) =
default;
28 LibRepType (EVP_PKEY* p);
33 struct IRep : Cryptography::PKI::PrivateKey::IRep {
34 virtual EVP_PKEY* Get_EVP_PKEY ()
const = 0;
39 struct Ptr : shared_ptr<IRep> {
40 using inherited = shared_ptr<IRep>;
46 using inherited::inherited;
47 Ptr (
const shared_ptr<IRep>& p);
48 Ptr (
const shared_ptr<PKI::PrivateKey::IRep>& p);
49 EVP_PKEY* Get_EVP_PKEY ()
const;
56 Ptr New (LibRepType&& pkey);
66#include "PrivateKey.inl"