All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | List of all members
ndn::ValidityPeriodLite Class Reference

A ValidityPeriodLite 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-lite.hpp>

Inheritance diagram for ndn::ValidityPeriodLite:
ndn_ValidityPeriod

Public Member Functions

 ValidityPeriodLite ()
 Create a default ValidityPeriodLite where the period is not specified.
 
bool hasPeriod () const
 Check if the period has been set. More...
 
ndn_MillisecondsSince1970 getNotBefore () const
 Get the beginning of the validity period range. More...
 
ndn_MillisecondsSince1970 getNotAfter () const
 Get the end of the validity period range. More...
 
void clear ()
 Reset to a default ValidityPeriod where the period is not specified.
 
ValidityPeriodLitesetPeriod (ndn_MillisecondsSince1970 notBefore, ndn_MillisecondsSince1970 notAfter)
 Set the validity period. More...
 
bool equals (const ValidityPeriodLite &other) const
 Check if this is the same validity period as other. More...
 
bool isValid (ndn_MillisecondsSince1970 time) const
 Check if the time falls within the validity period. More...
 

Static Public Member Functions

static ValidityPeriodLitedownCast (ndn_ValidityPeriod &validityPeriod)
 Downcast the reference to the ndn_ValidityPeriod struct to a ValidityPeriodLite. More...
 
static const ValidityPeriodLitedownCast (const ndn_ValidityPeriod &validityPeriod)
 

Detailed Description

A ValidityPeriodLite is used in a Data packet's SignatureInfo and represents the begin and end times of a certificate's validity period.

Member Function Documentation

static ValidityPeriodLite& ndn::ValidityPeriodLite::downCast ( ndn_ValidityPeriod validityPeriod)
inlinestatic

Downcast the reference to the ndn_ValidityPeriod struct to a ValidityPeriodLite.

Parameters
validityPeriodA reference to the ndn_ValidityPeriod struct.
Returns
The same reference as ValidityPeriodLite.
bool ndn::ValidityPeriodLite::equals ( const ValidityPeriodLite other) const

Check if this is the same validity period as other.

Parameters
otherThe other ValidityPeriodLite to compare with.
Returns
True if the validity periods are equal.
ndn_MillisecondsSince1970 ndn::ValidityPeriodLite::getNotAfter ( ) const
inline

Get the end of the validity period range.

Returns
The time as milliseconds since Jan 1, 1970 UTC.
ndn_MillisecondsSince1970 ndn::ValidityPeriodLite::getNotBefore ( ) const
inline

Get the beginning of the validity period range.

Returns
The time as milliseconds since Jan 1, 1970 UTC.
bool ndn::ValidityPeriodLite::hasPeriod ( ) const

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).
bool ndn::ValidityPeriodLite::isValid ( ndn_MillisecondsSince1970  time) const

Check if the time falls within the validity period.

Parameters
timeThe time to check as milliseconds since Jan 1, 1970 UTC.
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.
ValidityPeriodLite & ndn::ValidityPeriodLite::setPeriod ( ndn_MillisecondsSince1970  notBefore,
ndn_MillisecondsSince1970  notAfter 
)

Set the validity period.

Parameters
notBeforeThe beginning of the validity period range as milliseconds since Jan 1, 1970 UTC. Note that this is rounded up to the nearest whole second.
notAfterThe 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 ValidityPeriodLite so that you can chain calls to update values.

The documentation for this class was generated from the following files: