Search in sources :

Example 1 with SignatureValidationParametersCriterion

use of org.opensaml.xmlsec.signature.support.SignatureValidationParametersCriterion in project cas by apereo.

the class SamlUtils method buildSignatureValidationFilterCriteria.

@SneakyThrows
private static CriteriaSet buildSignatureValidationFilterCriteria() {
    val criteriaSet = new CriteriaSet();
    val sigConfigs = new ArrayList<SignatureValidationConfiguration>();
    sigConfigs.add(SecurityConfigurationSupport.getGlobalSignatureValidationConfiguration());
    if (!sigConfigs.isEmpty()) {
        val paramsResolver = new BasicSignatureValidationParametersResolver();
        val configCriteria = new CriteriaSet(new SignatureValidationConfigurationCriterion(sigConfigs));
        val params = paramsResolver.resolveSingle(configCriteria);
        if (params != null) {
            criteriaSet.add(new SignatureValidationParametersCriterion(params), true);
        }
    }
    return criteriaSet;
}
Also used : lombok.val(lombok.val) BasicSignatureValidationParametersResolver(org.opensaml.xmlsec.impl.BasicSignatureValidationParametersResolver) SignatureValidationParametersCriterion(org.opensaml.xmlsec.signature.support.SignatureValidationParametersCriterion) CriteriaSet(net.shibboleth.utilities.java.support.resolver.CriteriaSet) ArrayList(java.util.ArrayList) SignatureValidationConfigurationCriterion(org.opensaml.xmlsec.criterion.SignatureValidationConfigurationCriterion) SneakyThrows(lombok.SneakyThrows)

Aggregations

ArrayList (java.util.ArrayList)1 SneakyThrows (lombok.SneakyThrows)1 lombok.val (lombok.val)1 CriteriaSet (net.shibboleth.utilities.java.support.resolver.CriteriaSet)1 SignatureValidationConfigurationCriterion (org.opensaml.xmlsec.criterion.SignatureValidationConfigurationCriterion)1 BasicSignatureValidationParametersResolver (org.opensaml.xmlsec.impl.BasicSignatureValidationParametersResolver)1 SignatureValidationParametersCriterion (org.opensaml.xmlsec.signature.support.SignatureValidationParametersCriterion)1