net.ripe.rpki.commons.crypto
Class ValidityPeriod
java.lang.Object
net.ripe.rpki.commons.util.EqualsSupport
net.ripe.rpki.commons.crypto.ValidityPeriod
- All Implemented Interfaces:
- Serializable
public class ValidityPeriod
- extends EqualsSupport
- implements Serializable
Validity period used by the certification system. Since certificates only
have up-to second accuracy with validity fields, this class truncates not
before and not after to second accuracy.
- See Also:
- Serialized Form
ValidityPeriod
public ValidityPeriod()
ValidityPeriod
public ValidityPeriod(org.joda.time.ReadableInstant notValidBefore,
org.joda.time.ReadableInstant notValidAfter)
ValidityPeriod
public ValidityPeriod(Date notValidBefore,
Date notValidAfter)
getNotValidAfter
public org.joda.time.DateTime getNotValidAfter()
getNotValidBefore
public org.joda.time.DateTime getNotValidBefore()
withNotValidBefore
public ValidityPeriod withNotValidBefore(org.joda.time.ReadableInstant notValidBefore)
withNotValidAfter
public ValidityPeriod withNotValidAfter(org.joda.time.ReadableInstant notValidAfter)
contains
public boolean contains(ValidityPeriod other)
isExpiredNow
public boolean isExpiredNow()
isExpiredAt
public boolean isExpiredAt(org.joda.time.ReadableInstant instant)
isValidNow
public boolean isValidNow()
isValidAt
public boolean isValidAt(org.joda.time.ReadableInstant instant)
isClosed
public boolean isClosed()
- Returns:
- true if this instances notValidBefore and notValidAfter are both
specified.
intersectedWith
public ValidityPeriod intersectedWith(ValidityPeriod other)
- Calculates the intersection of two validity periods, taking into account
open-ended validity periods.
- Parameters:
other - the validity period to intersect with.
- Returns:
- the intersection of this and the other validity period, or null
if there is no overlap.
toString
public String toString()
- Overrides:
toString in class EqualsSupport
Copyright © 2008-2012 RIPE NCC, the Netherlands. All Rights Reserved.