be.fgov.ehealth.etee.crypto.utils
Class TimeFrameValidator

java.lang.Object
  extended by be.fgov.ehealth.etee.crypto.utils.TimeFrameValidator

public final class TimeFrameValidator
extends java.lang.Object

Utility class to validate a timeframe with a clock skew.


Method Summary
static TimeFrameValidator create(long acceptedClockSkew)
           
 boolean validate(java.util.Date minDate, java.util.Date dateInBetween, java.util.Date maxDate)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static TimeFrameValidator create(long acceptedClockSkew)
Parameters:
acceptedClockSkew - amount of time in millis that is acceptable to cross a certain time (before or after).
Returns:
an instance with the given clock skew preconfig

validate

public boolean validate(java.util.Date minDate,
                        java.util.Date dateInBetween,
                        java.util.Date maxDate)
Parameters:
minDate - if null, no minimal check is done
dateInBetween - if null, current date is used
maxDate - if null, no maximum check is done
Returns:
true if dateInBetween is not before minDate or after maxDate, with a clockSkew


Copyright © 2019 eHealth. All Rights Reserved.