#pragma once #include "types.h" #include "KeyBag.h" #include #include namespace nstool { class PkiValidator { public: PkiValidator(); void setKeyCfg(const KeyBag& keycfg); void addCertificates(const std::vector>& certs); void addCertificate(const pie::hac::es::SignedData& cert); void clearCertificates(); void validateSignature(const std::string& issuer, pie::hac::es::sign::SignatureId signature_id, const tc::ByteData& signature, const tc::ByteData& hash) const; private: std::string mModuleName; KeyBag mKeyCfg; std::vector> mCertificateBank; void makeCertIdent(const pie::hac::es::SignedData& cert, std::string& ident) const; void makeCertIdent(const std::string& issuer, const std::string& subject, std::string& ident) const; bool doesCertExist(const std::string& ident) const; const pie::hac::es::SignedData& getCert(const std::string& ident) const; }; }