Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
PrivateKey.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5namespace Stroika::Foundation::Cryptography::Providers::OpenSSL::PrivateKey {
6
7#if qStroika_HasComponent_OpenSSL
8 /*
9 ********************************************************************************
10 ********************* OpenSSL::PrivateKey::LibRepType **************************
11 ********************************************************************************
12 */
13 inline LibRepType::LibRepType (nullptr_t)
14 : inherited{nullptr, &::EVP_PKEY_free}
15 {
16 }
17 inline LibRepType::LibRepType (EVP_PKEY* p)
18 : inherited{p, &::EVP_PKEY_free}
19 {
20 }
21
22 /*
23 ********************************************************************************
24 *************************** OpenSSL::PrivateKey::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::PrivateKey::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 EVP_PKEY* Ptr::Get_EVP_PKEY () const
41 {
42 return get ()->Get_EVP_PKEY ();
43 }
44
45#endif
46
47}