public static void createTimedConditions(AssertionType assertion, long durationInMilis)
throws ConfigurationException, IssueInstantMissingException
{
XMLGregorianCalendar issueInstant = assertion.getIssueInstant();
if(issueInstant == null)
throw new IssueInstantMissingException("assertion does not have issue instant");
XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis);
ConditionsType conditionsType = JBossSAMLBaseFactory.getObjectFactory().createConditionsType();
conditionsType.setNotBefore(issueInstant);
conditionsType.setNotOnOrAfter(assertionValidityLength);