Class: ValidityPeriod

ValidityPeriod

new ValidityPeriod(value)

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 new ValidityPeriod object, possibly copying values from another object.
Parameters:
Name Type Description
value ValidityPeriod (optional) If value is a ValidityPeriod, copy its values. If value is omitted, reate a default ValidityPeriodLite where the period is not specified.
Source:

Methods

clear()

Reset to a default ValidityPeriod where the period is not specified.
Source:

getChangeCount() → {number}

Get the change count, which is incremented each time this object is changed.
Source:
Returns:
The change count.
Type
number

getNotAfter() → {number}

Get the end of the validity period range.
Source:
Returns:
The time as milliseconds since Jan 1, 1970 UTC.
Type
number

getNotBefore() → {number}

Get the beginning of the validity period range.
Source:
Returns:
The time as milliseconds since Jan 1, 1970 UTC.
Type
number

hasPeriod() → {boolean}

Check if the period has been set.
Source:
Returns:
True if the period has been set, false if the period is not specified (after calling the default constructor or clear).
Type
boolean

isValid(time) → {boolean}

Check if the time falls within the validity period.
Parameters:
Name Type Description
time number The time to check as milliseconds since Jan 1, 1970 UTC.
Source:
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.
Type
boolean

setPeriod(notBefore, notAfter) → {ValidityPeriod}

Set the validity period.
Parameters:
Name Type Description
notBefore number 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 number 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.
Source:
Returns:
This ValidityPeriod so that you can chain calls to update values.
Type
ValidityPeriod