A ValidityPeriod is used in a Data packet's SignatureInfo and represents the begin and end times of a certificate's validity period.
More...
#include <validity-period.hpp>
A ValidityPeriod is used in a Data packet's SignatureInfo and represents the begin and end times of a certificate's validity period.
Create a ValidityPeriod with the given period.
- Parameters
-
| notBefore | The beginning of the validity period range as milliseconds since Jan 1, 1970 UTC. Note that this is rounded up to the nearest whole second. |
| notAfter | The end of the validity period range as milliseconds since Jan 1, 1970 UTC. Note that this is rounded down to the nearest whole second. |
| bool ndn::ValidityPeriod::canGetFromSignature |
( |
const Signature * |
signature | ) |
|
|
static |
If the signature is a type that has a ValidityPeriod (so that getFromSignature will succeed), return true.
Note: This is a static method of ValidityPeriod instead of a method of Signature so that the Signature base class does not need to be overloaded with all the different kinds of information that various signature algorithms may use.
- Parameters
-
| signature | An object of a subclass of Signature. |
- Returns
- True if the signature is a type that has a ValidityPeriod, otherwise false.
| bool ndn::ValidityPeriod::equals |
( |
const ValidityPeriod & |
other | ) |
const |
|
inline |
Check if this is the same validity period as other.
- Parameters
-
- Returns
- True if the validity periods are equal.
Set validityPeriodLite to point to the values in this meta info object, without copying any memory.
WARNING: The resulting pointers in validityPeriodLite are invalid after a further use of this object which could reallocate memory.
- Parameters
-
| uint64_t ndn::ValidityPeriod::getChangeCount |
( |
| ) |
const |
|
inline |
Get the change count, which is incremented each time this object is changed.
- Returns
- The change count.
Get the end of the validity period range.
- Returns
- The time as milliseconds since Jan 1, 1970 UTC.
Get the beginning of the validity period range.
- Returns
- The time as milliseconds since Jan 1, 1970 UTC.
| bool ndn::ValidityPeriod::hasPeriod |
( |
| ) |
const |
|
inline |
Check if the period has been set.
- Returns
- True if the period has been set, false if the period is not specified (after calling the default constructor or clear).
Check if the time falls within the validity period.
- Parameters
-
| time | (optional) The time to check as milliseconds since Jan 1, 1970 UTC. If omitted, use the current time. |
- Returns
- True if the beginning of the validity period is less than or equal to time and time is less than or equal to the end of the validity period.
Clear this meta info, and set the values by copying from validityPeriodLite.
- Parameters
-
Set the validity period.
- Parameters
-
| notBefore | The beginning of the validity period range as milliseconds since Jan 1, 1970 UTC. Note that this is rounded up to the nearest whole second. |
| notAfter | The end of the validity period range as milliseconds since Jan 1, 1970 UTC. Note that this is rounded down to the nearest whole second. |
- Returns
- This ValidityPeriod so that you can chain calls to update values.
The documentation for this class was generated from the following files: