Dynamic trust anchor group. More...
#include <ndn-cxx/security/trust-anchor-group.hpp>
Public Member Functions | |
DynamicTrustAnchorGroup (CertContainerInterface &certContainer, const std::string &id, const std::filesystem::path &path, time::nanoseconds refreshPeriod, bool isDir=false) | |
Create a dynamic trust anchor group. More... | |
const std::string & | getId () const |
void | refresh () override |
Request certificate refresh. More... | |
size_t | size () const |
Protected Attributes | |
std::set< Name > | m_anchorNames |
CertContainerInterface & | m_certs |
Dynamic trust anchor group.
Definition at line 118 of file trust-anchor-group.hpp.
ndn::security::DynamicTrustAnchorGroup::DynamicTrustAnchorGroup | ( | CertContainerInterface & | certContainer, |
const std::string & | id, | ||
const std::filesystem::path & | path, | ||
time::nanoseconds | refreshPeriod, | ||
bool | isDir = false |
||
) |
Create a dynamic trust anchor group.
This contructor would load all the certificates from path
and will be refreshing certificates every refreshPeriod
time period.
Note that refresh is not scheduled, but is performed upon "find" operations.
When isDir
is false and path
doesn't point to a valid certificate (file doesn't exist or content is not a valid certificate), the dynamic anchor group will be empty until file gets created. If file disappears or gets corrupted, the anchor group becomes empty.
When idDir
is true and path
does't point to a valid folder, folder is empty, or doesn't contain valid certificates, the group will be empty until certificate files are placed in the folder. If folder is removed, becomes empty, or no longer contains valid certificates, the anchor group becomes empty.
Upon refresh, the existing certificates are not changed.
certContainer | A certificate container into which trust anchors from the group will be added |
id | Group id |
path | File path for trust anchor(s), could be directory or file. If it is a directory, all the certificates in the directory will be loaded. |
refreshPeriod | Refresh time for the anchors under path , must be positive. |
isDir | Tells whether the path is a directory or a single file. |
std::invalid_argument | refreshPeriod is negative |
Definition at line 81 of file trust-anchor-group.cpp.
|
inlineinherited |
Definition at line 64 of file trust-anchor-group.hpp.
|
overridevirtual |
Request certificate refresh.
Reimplemented from ndn::security::TrustAnchorGroup.
Definition at line 100 of file trust-anchor-group.cpp.
|
inherited |
Definition at line 43 of file trust-anchor-group.cpp.
|
protectedinherited |
Definition at line 83 of file trust-anchor-group.hpp.
|
protectedinherited |
Definition at line 82 of file trust-anchor-group.hpp.