I2P: End-to-End encrypted and anonymous Internet https://i2pd.website/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.0 KiB

/*
* Copyright (c) 2013-2022, 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
*/
9 years ago
#ifndef FAMILY_H__
#define FAMILY_H__
9 years ago
#include <map>
#include <string>
#include <memory>
#include "Signature.h"
#include "Identity.h"
9 years ago
namespace i2p
{
namespace data
{
typedef int FamilyID;
9 years ago
class Families
{
public:
Families ();
~Families ();
void LoadCertificates ();
bool VerifyFamily (const std::string& family, const IdentHash& ident,
const char * signature, const char * key = nullptr) const;
FamilyID GetFamilyID (const std::string& family) const;
9 years ago
private:
void LoadCertificate (const std::string& filename);
private:
std::map<std::string, std::pair<std::shared_ptr<i2p::crypto::Verifier>, FamilyID> > m_SigningKeys; // family -> (verifier, id)
};
std::string CreateFamilySignature (const std::string& family, const IdentHash& ident);
// return base64 signature of empty string in case of failure
9 years ago
}
}
#endif