2020-05-22 13:18:41 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
|
|
|
*
|
|
|
|
* This file is part of Purple i2pd project and licensed under BSD3
|
|
|
|
*
|
|
|
|
* See full license text in LICENSE file at top of project tree
|
|
|
|
*/
|
|
|
|
|
2016-02-18 20:57:43 +00:00
|
|
|
#ifndef FAMILY_H__
|
2016-02-21 01:20:19 +00:00
|
|
|
#define FAMILY_H__
|
2016-02-18 20:57:43 +00:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
#include "Signature.h"
|
2016-02-19 21:13:46 +00:00
|
|
|
#include "Identity.h"
|
2016-02-18 20:57:43 +00:00
|
|
|
|
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace data
|
|
|
|
{
|
|
|
|
class Families
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Families ();
|
|
|
|
~Families ();
|
|
|
|
void LoadCertificates ();
|
2018-01-06 03:48:51 +00:00
|
|
|
bool VerifyFamily (const std::string& family, const IdentHash& ident,
|
2016-02-19 21:37:41 +00:00
|
|
|
const char * signature, const char * key = nullptr);
|
2016-02-18 20:57:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void LoadCertificate (const std::string& filename);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
std::map<std::string, std::shared_ptr<i2p::crypto::Verifier> > m_SigningKeys;
|
2018-01-06 03:48:51 +00:00
|
|
|
};
|
2016-02-21 01:20:19 +00:00
|
|
|
|
|
|
|
std::string CreateFamilySignature (const std::string& family, const IdentHash& ident);
|
|
|
|
// return base64 signature of empty string in case of failure
|
2016-02-18 20:57:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|