The way to check if the assertion is expired is to check the conditions in the assertion. Something like this.
if (assertion.getConditions().getNotBefore() != null && assertion.getConditions().getNotBefore().isAfterNow()) {
throw new ValidationException("Condition states that assertion is not yet valid (is the server time correct?)");
}
if (assertion.getConditions().getNotOnOrAfter() != null
&& (assertion.getConditions().getNotOnOrAfter().isBeforeNow() || assertion.getConditions().getNotOnOrAfter().isEqualNow())) {
throw new ValidationException("Condition states that assertion is no longer valid (is the server time correct?)");
}
As far as I now there is no simpler method for doing this. The right way is probably to write a validator, maybe extend the ConditionsSpecValidator. This Validator does not bye itself validate all conditions