Family.h 721 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef FAMILY_H__
  2. #define FAMILY_H__
  3. #include <map>
  4. #include <string>
  5. #include <memory>
  6. #include "Signature.h"
  7. #include "Identity.h"
  8. namespace i2p
  9. {
  10. namespace data
  11. {
  12. class Families
  13. {
  14. public:
  15. Families ();
  16. ~Families ();
  17. void LoadCertificates ();
  18. bool VerifyFamily (const std::string& family, const IdentHash& ident,
  19. const char * signature, const char * key = nullptr);
  20. private:
  21. void LoadCertificate (const std::string& filename);
  22. private:
  23. std::map<std::string, std::shared_ptr<i2p::crypto::Verifier> > m_SigningKeys;
  24. };
  25. std::string CreateFamilySignature (const std::string& family, const IdentHash& ident);
  26. // return base64 signature of empty string in case of failure
  27. }
  28. }
  29. #endif