/** * <p> * Creates a {@code Conditions} instance with the specified values. * </p> * * @param notBefore a {@code XMLGregorianCalendar} representing the start of the token lifetime period. * @param notOnOrAfter a {@code XMLGregorianCalendar} representing the end of the token lifetime period. * @param restrictions an array containing the applicable restrictions. * @return the constructed {@code Conditions} instance. */ public static ConditionsType createConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions) { ConditionsType conditions = new ConditionsType(); conditions.setNotBefore(notBefore); conditions.setNotOnOrAfter(notOnOrAfter); if (restrictions != null) { for (ConditionAbstractType condition : restrictions) { conditions.addCondition(condition); } } return conditions; }
/** * <p> * Creates a {@code Conditions} instance with the specified values. * </p> * * @param notBefore a {@code XMLGregorianCalendar} representing the start of the token lifetime period. * @param notOnOrAfter a {@code XMLGregorianCalendar} representing the end of the token lifetime period. * @param restrictions an array containing the applicable restrictions. * @return the constructed {@code Conditions} instance. */ public static ConditionsType createConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions) { ConditionsType conditions = new ConditionsType(); conditions.setNotBefore(notBefore); conditions.setNotOnOrAfter(notOnOrAfter); if (restrictions != null) { for (ConditionAbstractType condition : restrictions) { conditions.addCondition(condition); } } return conditions; }
/** * <p> * Creates a {@code Conditions} instance with the specified values. * </p> * * @param notBefore a {@code XMLGregorianCalendar} representing the start of the token lifetime period. * @param notOnOrAfter a {@code XMLGregorianCalendar} representing the end of the token lifetime period. * @param restrictions an array containing the applicable restrictions. * * @return the constructed {@code Conditions} instance. */ public static ConditionsType createConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions) { ConditionsType conditions = new ConditionsType(); conditions.setNotBefore(notBefore); conditions.setNotOnOrAfter(notOnOrAfter); if (restrictions != null) { for (ConditionAbstractType condition : restrictions) { conditions.addCondition(condition); } } return conditions; }
/** * <p> * Creates a {@code Conditions} instance with the specified values. * </p> * * @param notBefore a {@code XMLGregorianCalendar} representing the start of the token lifetime period. * @param notOnOrAfter a {@code XMLGregorianCalendar} representing the end of the token lifetime period. * @param restrictions an array containing the applicable restrictions. * * @return the constructed {@code Conditions} instance. */ public static ConditionsType createConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions) { ConditionsType conditions = new ConditionsType(); conditions.setNotBefore(notBefore); conditions.setNotOnOrAfter(notOnOrAfter); if (restrictions != null) { for (ConditionAbstractType condition : restrictions) { conditions.addCondition(condition); } } return conditions; }
/** * <p> * Creates a {@code Conditions} instance with the specified values. * </p> * * @param notBefore a {@code XMLGregorianCalendar} representing the start of the token lifetime period. * @param notOnOrAfter a {@code XMLGregorianCalendar} representing the end of the token lifetime period. * @param restrictions an array containing the applicable restrictions. * @return the constructed {@code Conditions} instance. */ public static ConditionsType createConditions(XMLGregorianCalendar notBefore, XMLGregorianCalendar notOnOrAfter, ConditionAbstractType... restrictions) { ConditionsType conditions = new ConditionsType(); conditions.setNotBefore(notBefore); conditions.setNotOnOrAfter(notOnOrAfter); if (restrictions != null) { for (ConditionAbstractType condition : restrictions) { conditions.addCondition(condition); } } return conditions; }
/** * <p> * Add validity conditions to the SAML2 Assertion * </p> * <p> * There is no clock skew added. * * @see {{@link #createTimedConditions(AssertionType, long, long)} * </p> * @param assertion * @param durationInMilis * @throws ConfigurationException * @throws IssueInstantMissingException */ public static void createTimedConditions(AssertionType assertion, long durationInMilis) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis); ConditionsType conditionsType = new ConditionsType(); conditionsType.setNotBefore(issueInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * <p> * Add validity conditions to the SAML2 Assertion * </p> * <p> * There is no clock skew added. * @see {{@link #createTimedConditions(AssertionType, long, long)} * </p> * @param assertion * @param durationInMilis * @throws ConfigurationException * @throws IssueInstantMissingException */ public static void createTimedConditions(AssertionType assertion, long durationInMilis) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis); ConditionsType conditionsType = new ConditionsType(); conditionsType.setNotBefore(issueInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * <p> * Add validity conditions to the SAML2 Assertion * </p> * <p> * There is no clock skew added. * @see {{@link #createTimedConditions(AssertionType, long, long)} * </p> * @param assertion * @param durationInMilis * @throws ConfigurationException * @throws IssueInstantMissingException */ public static void createTimedConditions(AssertionType assertion, long durationInMilis) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis); ConditionsType conditionsType = new ConditionsType(); conditionsType.setNotBefore(issueInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * <p> * Add validity conditions to the SAML2 Assertion * </p> * <p> * There is no clock skew added. * * @param assertion * @param durationInMilis * * @throws ConfigurationException * @throws IssueInstantMissingException * @see {{@link #createTimedConditions(AssertionType, long, long)} * </p> */ public static void createTimedConditions(AssertionType assertion, long durationInMilis) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis); ConditionsType conditionsType = new ConditionsType(); conditionsType.setNotBefore(issueInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * <p> * Add validity conditions to the SAML2 Assertion * </p> * <p> * There is no clock skew added. * * @param assertion * @param durationInMilis * * @throws ConfigurationException * @throws IssueInstantMissingException * @see {{@link #createTimedConditions(AssertionType, long, long)} * </p> */ public static void createTimedConditions(AssertionType assertion, long durationInMilis) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis); ConditionsType conditionsType = new ConditionsType(); conditionsType.setNotBefore(issueInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * Add validity conditions to the SAML2 Assertion * @param assertion * @param durationInMilis * @throws ConfigurationException * @throws IssueInstantMissingException */ public static void createTimedConditions(AssertionType assertion, long durationInMilis, long clockSkew) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis + clockSkew); ConditionsType conditionsType = new ConditionsType(); XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew); conditionsType.setNotBefore(beforeInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * Add validity conditions to the SAML2 Assertion * * @param assertion * @param durationInMilis * * @throws ConfigurationException * @throws IssueInstantMissingException */ public static void createTimedConditions(AssertionType assertion, long durationInMilis, long clockSkew) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw logger.samlIssueInstantMissingError(); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis + clockSkew); ConditionsType conditionsType = new ConditionsType(); XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew); conditionsType.setNotBefore(beforeInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * Add validity conditions to the SAML2 Assertion * * @param assertion * @param durationInMilis * @throws ConfigurationException * @throws IssueInstantMissingException */ public static void createTimedConditions(AssertionType assertion, long durationInMilis, long clockSkew) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw logger.samlIssueInstantMissingError(); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis + clockSkew); ConditionsType conditionsType = new ConditionsType(); XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew); conditionsType.setNotBefore(beforeInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * Add validity conditions to the SAML2 Assertion * @param assertion * @param durationInMilis * @throws ConfigurationException * @throws IssueInstantMissingException */ public static void createTimedConditions(AssertionType assertion, long durationInMilis, long clockSkew) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw new IssueInstantMissingException(ErrorCodes.NULL_ISSUE_INSTANT); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis + clockSkew); ConditionsType conditionsType = new ConditionsType(); XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew); conditionsType.setNotBefore(beforeInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
/** * Add validity conditions to the SAML2 Assertion * * @param assertion * @param durationInMilis * * @throws ConfigurationException * @throws IssueInstantMissingException */ public static void createTimedConditions(AssertionType assertion, long durationInMilis, long clockSkew) throws ConfigurationException, IssueInstantMissingException { XMLGregorianCalendar issueInstant = assertion.getIssueInstant(); if (issueInstant == null) throw logger.samlIssueInstantMissingError(); XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis + clockSkew); ConditionsType conditionsType = new ConditionsType(); XMLGregorianCalendar beforeInstant = XMLTimeUtil.subtract(issueInstant, clockSkew); conditionsType.setNotBefore(beforeInstant); conditionsType.setNotOnOrAfter(assertionValidityLength); assertion.setConditions(conditionsType); }
conditions.setNotBefore(XMLTimeUtil.parse(notBeforeValue));
conditions.setNotBefore(context.getRequestSecurityToken().getLifetime().getCreated()); conditions.setNotOnOrAfter(context.getRequestSecurityToken().getLifetime().getExpires());
conditions.setNotBefore(lifetime.getCreated()); conditions.setNotOnOrAfter(lifetime.getExpires());
conditions.setNotBefore(lifetime.getCreated()); conditions.setNotOnOrAfter(lifetime.getExpires());
conditions.setNotBefore(context.getRequestSecurityToken().getLifetime().getCreated()); conditions.setNotOnOrAfter(context.getRequestSecurityToken().getLifetime().getExpires());