#pragma once #include "hashed_id8.hpp" #include #include #include #include #include #include #include namespace vanetza { namespace pki { class CertificateRevocationList; class SecurityModule; /** * Constructor scans \p root and indexes every "*.crl" file. * store() replaces any prior CRL from the same issuer (one file per issuer). */ class CrlFilesystemStore : public security::v3::RevocationLookup { public: CrlFilesystemStore(std::shared_ptr, const std::filesystem::path& root); // Returns false if the CRL has no extractable issuer or a malformed payload. bool store(const CertificateRevocationList&); bool is_revoked(const security::HashedId8& issuer, const security::HashedId8& cert) const override; protected: std::filesystem::path filename(const HashedId8&) const; boost::optional index(const CertificateRevocationList&); private: std::shared_ptr m_security; std::filesystem::path m_root; std::unordered_map> m_revoked; }; } // namespace pki } // namespace vanetza