23 #ifndef NDN_GROUP_MANAGER_HPP
24 #define NDN_GROUP_MANAGER_HPP
26 #include "../security/certificate/identity-certificate.hpp"
27 #include "group-manager-db.hpp"
30 class TestGroupManager_CreateDKeyData_Test;
31 class TestGroupManager_CreateEKeyData_Test;
32 class TestGroupManager_CalculateInterval_Test;
60 (
const Name& prefix,
const Name& dataType,
61 const ptr_lib::shared_ptr<GroupManagerDb>& database, uint32_t keySize,
62 int freshnessHours,
KeyChain* keyChain);
83 std::vector<ptr_lib::shared_ptr<Data> >& result,
84 bool needRegenerate =
true);
96 database_->addSchedule(scheduleName, schedule);
108 database_->deleteSchedule(scheduleName);
122 database_->updateSchedule(scheduleName, schedule);
141 (scheduleName, cert.getPublicKeyName(), cert.getPublicKeyInfo().getKeyDer());
153 database_->deleteMember(identity);
166 database_->updateMemberSchedule(identity, scheduleName);
180 friend TestGroupManager_CreateDKeyData_Test;
181 friend TestGroupManager_CreateEKeyData_Test;
182 friend TestGroupManager_CalculateInterval_Test;
205 generateKeyPair(
Blob& privateKeyBlob,
Blob& publicKeyBlob);
215 ptr_lib::shared_ptr<Data>
217 (
const std::string& startTimeStamp,
const std::string& endTimeStamp,
218 const Blob& publicKeyBlob);
233 ptr_lib::shared_ptr<Data>
235 (
const std::string& startTimeStamp,
const std::string& endTimeStamp,
236 const Name& keyName,
const Blob& privateKeyBlob,
const Blob& certificateKey);
247 addEKey(
const Name& eKeyName,
const Blob& publicKey,
const Blob& privateKey)
249 database_->addEKey(eKeyName, publicKey, privateKey);
261 getEKey(
const Name& eKeyName, Blob& publicKey, Blob& privateKey)
263 database_->getEKey(eKeyName, publicKey, privateKey);
273 deleteEKey(
const Name& eKeyName)
275 database_-> deleteEKey(eKeyName);
279 ptr_lib::shared_ptr<GroupManagerDb> database_;
283 static const uint64_t MILLISECONDS_IN_HOUR = 3600 * 1000;
A GroupManager manages keys and schedules for group members in a particular namespace.
Definition: group-manager.hpp:43
An Interval defines a time duration which contains a start timestamp and an end timestamp.
Definition: interval.hpp:36
void deleteSchedule(const std::string &scheduleName)
Delete the schedule with the given scheduleName.
Definition: group-manager.hpp:106
void updateMemberSchedule(const Name &identity, const std::string &scheduleName)
Change the name of the schedule for the given member's identity name.
Definition: group-manager.hpp:164
Schedule is used to manage the times when a member can access data using two sets of RepetitiveInterv...
Definition: schedule.hpp:43
void removeMember(const Name &identity)
Remove a member with the given identity name.
Definition: group-manager.hpp:151
Definition: identity-certificate.hpp:30
void getGroupKey(MillisecondsSince1970 timeSlot, std::vector< ptr_lib::shared_ptr< Data > > &result, bool needRegenerate=true)
Create a group key for the interval into which timeSlot falls.
Definition: group-manager.cpp:48
void addSchedule(const std::string &scheduleName, const Schedule &schedule)
Add a schedule with the given scheduleName.
Definition: group-manager.hpp:94
KeyChain is the main class of the security library.
Definition: key-chain.hpp:53
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.
Definition: blob.hpp:42
GroupManager(const Name &prefix, const Name &dataType, const ptr_lib::shared_ptr< GroupManagerDb > &database, uint32_t keySize, int freshnessHours, KeyChain *keyChain)
Create a group manager with the given values.
Definition: group-manager.cpp:34
double MillisecondsSince1970
The calendar time represented as the number of milliseconds since 1/1/1970.
Definition: common.hpp:119
void addMember(const std::string &scheduleName, const Data &memberCertificate)
Add a new member with the given memberCertificate into a schedule named scheduleName.
Definition: group-manager.hpp:137
void updateSchedule(const std::string &scheduleName, const Schedule &schedule)
Update the schedule with scheduleName and replace the old object with the given schedule.
Definition: group-manager.hpp:120
void cleanEKeys()
Delete all the EKeys in the database.
Definition: group-manager.hpp:176