1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package edu.internet2.middleware.shibboleth.common.config.security;
18
19 import javax.xml.namespace.QName;
20
21 import org.opensaml.xml.security.x509.CertPathPKIXValidationOptions;
22 import org.opensaml.xml.util.XMLHelper;
23 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
24 import org.w3c.dom.Attr;
25 import org.w3c.dom.Element;
26
27
28
29 public class CertPathPKIXValidationOptionsBeanDefinitionParser extends PKIXValidationOptionsBeanDefinitionParser {
30
31
32 public static final QName SCHEMA_TYPE = new QName(SecurityNamespaceHandler.NAMESPACE, "CertPathValidationOptionsType");
33
34
35 protected Class getBeanClass(Element element) {
36 return CertPathPKIXValidationOptions.class;
37 }
38
39
40 protected boolean shouldGenerateId() {
41 return true;
42 }
43
44
45 protected void doParse(Element element, BeanDefinitionBuilder builder) {
46 super.doParse(element, builder);
47
48 if (element.hasAttributeNS(null, "forceRevocationEnabled")) {
49 Attr attr = element.getAttributeNodeNS(null, "forceRevocationEnabled");
50 builder.addPropertyValue("forceRevocationEnabled", XMLHelper.getAttributeValueAsBoolean(attr));
51 }
52
53 if (element.hasAttributeNS(null, "revocationEnabled")) {
54 Attr attr = element.getAttributeNodeNS(null, "revocationEnabled");
55 builder.addPropertyValue("revocationEnabled", XMLHelper.getAttributeValueAsBoolean(attr));
56 }
57
58 }
59
60 }