4#ifndef _Stroika_Foundation_Cryptography_PEMFile_h_
5#define _Stroika_Foundation_Cryptography_PEMFile_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
12#include "Stroika/Foundation/Containers/Sequence.h"
13#include "Stroika/Foundation/Cryptography/PKI/Certificate.h"
14#include "Stroika/Foundation/Cryptography/PKI/PrivateKey.h"
29namespace Stroika::Foundation::Cryptography::PKI::PEMFile {
31 using Containers::Sequence;
33 using Traversal::Iterable;
40 using EntryType = variant<Certificate::Ptr, PrivateKey::Ptr>;
46 virtual ~IRep () =
default;
49 virtual BLOB GetData ()
const = 0;
55 struct Ptr : shared_ptr<IRep> {
56 using inherited = shared_ptr<IRep>;
59 using inherited::inherited;
63 BLOB GetData ()
const;
64 Sequence<EntryType> GetEntries ()
const;
65 template <Common::IAnyOf<Certificate::Ptr, PrivateKey::Ptr> T>
66 Iterable<T> GetByType ()
const;
90 Ptr New (
const filesystem::path& pemFile);
91 Ptr New (
const BLOB& pemData);
92 Ptr New (
const Sequence<EntryType>& entries);
101#include "PEMFile.inl"
variant< Certificate::Ptr, PrivateKey::Ptr > EntryType
String is like std::u32string, except it is much easier to use, often much more space efficient,...
A generalization of a vector: a container whose elements are keyed by the natural numbers.