Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
PKI/PEMFile.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
5namespace Stroika::Foundation::Cryptography::PKI {
6
7 /*
8 ********************************************************************************
9 ************************ Cryptography::PEMFile::Ptr ****************************
10 ********************************************************************************
11 */
12 inline Memory::BLOB PEMFile::Ptr::GetData () const
13 {
14 return get ()->GetData ();
15 }
16 inline auto PEMFile::Ptr::GetEntries () const -> Sequence<EntryType>
17 {
18 return get ()->GetEntries ();
19 }
20 template <Common::IAnyOf<Certificate::Ptr, PrivateKey::Ptr> T>
21 inline auto PEMFile::Ptr::GetByType () const -> Iterable<T>
22 {
23 return GetEntries ().Map<Iterable<T>> ([] (const auto& e) -> optional<T> {
24 if (auto o = get_if<T> (&e)) {
25 return *o;
26 }
27 else {
28 return nullopt;
29 }
30 });
31 }
32
33}