Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Certificate.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5namespace Stroika::Foundation::Cryptography::Providers::OpenSSL::Certificate {
6
7#if qStroika_HasComponent_OpenSSL
8 /*
9 ********************************************************************************
10 ********************* OpenSSL::Certificate::LibRepType *************************
11 ********************************************************************************
12 */
13 inline LibRepType::LibRepType (nullptr_t)
14 : inherited{nullptr, &::X509_free}
15 {
16 }
17 inline LibRepType::LibRepType (X509* p)
18 : inherited{p, &::X509_free}
19 {
20 }
21
22 /*
23 ********************************************************************************
24 *************************** OpenSSL::Certificate::Ptr **************************
25 ********************************************************************************
26 */
27 inline Ptr::Ptr (const shared_ptr<IRep>& p)
28 : inherited{p}
29 {
30 }
31 inline Ptr::Ptr (const shared_ptr<PKI::Certificate::IRep>& p)
32 {
33 if (auto pp = dynamic_pointer_cast<IRep> (p)) [[likely]] {
34 *this = Ptr{pp};
35 }
36 else {
37 Execution::Throw (bad_cast{});
38 }
39 }
40 inline X509* Ptr::Get_X509 () const
41 {
42 return get ()->Get_X509 ();
43 }
44#endif
45
46}