A GroupManager manages keys and schedules for group members in a particular namespace.
More...
#include <group-manager.hpp>
|
| | 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. More...
|
| |
| 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. More...
|
| |
| void | addSchedule (const std::string &scheduleName, const Schedule &schedule) |
| | Add a schedule with the given scheduleName. More...
|
| |
| void | deleteSchedule (const std::string &scheduleName) |
| | Delete the schedule with the given scheduleName. More...
|
| |
| void | updateSchedule (const std::string &scheduleName, const Schedule &schedule) |
| | Update the schedule with scheduleName and replace the old object with the given schedule. More...
|
| |
| void | addMember (const std::string &scheduleName, const Data &memberCertificate) |
| | Add a new member with the given memberCertificate into a schedule named scheduleName. More...
|
| |
| void | removeMember (const Name &identity) |
| | Remove a member with the given identity name. More...
|
| |
| void | updateMemberSchedule (const Name &identity, const std::string &scheduleName) |
| | Change the name of the schedule for the given member's identity name. More...
|
| |
| void | cleanEKeys () |
| | Delete all the EKeys in the database. More...
|
| |
A GroupManager manages keys and schedules for group members in a particular namespace.
- Note
- This class is an experimental feature. The API may change.
| ndn::GroupManager::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.
The group manager namespace is /{prefix}/read/{dataType} .
- Parameters
-
| prefix | The prefix for the group manager namespace. |
| dataType | The data type for the group manager namespace. |
| database | The GroupManagerDb for storing the group management information (including user public keys and schedules). |
| keySize | The group key will be an RSA key with keySize bits. |
| freshnessHours | The number of hours of the freshness period of data packets carrying the keys. |
| keyChain | The KeyChain to use for signing data packets. This signs with the default identity. This is only a pointer to a KeyChain object which must remain valid for the life of this GroupManager. |
| void ndn::GroupManager::addMember |
( |
const std::string & |
scheduleName, |
|
|
const Data & |
memberCertificate |
|
) |
| |
|
inline |
Add a new member with the given memberCertificate into a schedule named scheduleName.
If cert is an IdentityCertificate made from memberCertificate, then the member's identity name is cert.getPublicKeyName().getPrefix(-1).
- Parameters
-
| scheduleName | The schedule name. |
| memberCertificate | The member's certificate. |
- Exceptions
-
| GroupManagerDb::Error | If there's no schedule named scheduleName, if the member's identity name already exists, or other database error. |
| DerDecodingException | for error decoding memberCertificate as a certificate. |
| void ndn::GroupManager::addSchedule |
( |
const std::string & |
scheduleName, |
|
|
const Schedule & |
schedule |
|
) |
| |
|
inline |
Add a schedule with the given scheduleName.
- Parameters
-
| scheduleName | The name of the schedule. The name cannot be empty. |
| schedule | The Schedule to add. |
- Exceptions
-
| GroupManagerDb::Error | if a schedule with the same name already exists, if the name is empty, or other database error. |
| void ndn::GroupManager::cleanEKeys |
( |
| ) |
|
|
inline |
Delete all the EKeys in the database.
The database will keep growing because EKeys will keep being added, so this method should be called periodically.
- Exceptions
-
| void ndn::GroupManager::deleteSchedule |
( |
const std::string & |
scheduleName | ) |
|
|
inline |
Delete the schedule with the given scheduleName.
Also delete members which use this schedule. If there is no schedule with the name, then do nothing.
- Parameters
-
| scheduleName | The name of the schedule. |
- Exceptions
-
| void ndn::GroupManager::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.
This creates a group key if it doesn't exist, and encrypts the key using the public key of each eligible member.
- Parameters
-
| timeSlot | The time slot to cover as milliseconds since Jan 1, 1970 UTC. |
| result | This clears result and sets it to a List of Data packets where the first is the E-KEY data packet with the group's public key and the rest are the D-KEY data packets with the group's private key encrypted with the public key of each eligible member. |
| needRegenerate | needRegenerate (optional) should be true if this is the first time this method is called, or a member was removed. needRegenerate can be false if this is not the first time this method is called, or a member was added. If omitted, use true. |
- Exceptions
-
| void ndn::GroupManager::removeMember |
( |
const Name & |
identity | ) |
|
|
inline |
Remove a member with the given identity name.
If there is no member with the identity name, then do nothing.
- Parameters
-
| identity | The member's identity name. |
- Exceptions
-
| void ndn::GroupManager::updateMemberSchedule |
( |
const Name & |
identity, |
|
|
const std::string & |
scheduleName |
|
) |
| |
|
inline |
Change the name of the schedule for the given member's identity name.
- Parameters
-
| identity | The member's identity name. |
| scheduleName | The new schedule name. |
- Exceptions
-
| GroupManagerDb::Error | if there's no member with the given identity name in the database, or there's no schedule named scheduleName. |
| void ndn::GroupManager::updateSchedule |
( |
const std::string & |
scheduleName, |
|
|
const Schedule & |
schedule |
|
) |
| |
|
inline |
Update the schedule with scheduleName and replace the old object with the given schedule.
Otherwise, if no schedule with name exists, a new schedule with name and the given schedule will be added to database.
- Parameters
-
| scheduleName | The name of the schedule. The name cannot be empty. |
| schedule | The Schedule to update or add. |
- Exceptions
-
The documentation for this class was generated from the following files: