[java-identity-provider COMMIT] in /trunk/idp-profile-spring/src: main/java/net/shibboleth/idp/profile/spring/relying...
noreply at shibboleth.net
noreply at shibboleth.net
Sat Jul 5 11:22:41 EDT 2014
Author: rdw
Date: Sat Jul 5 11:22:41 2014
New Revision: 6232
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6232&view=rev
Log:
IDP-390 Parser for the StaticPKIXSignature Trust Engine
Added:
trunk/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/StaticPKIXSignatureParserTest.java (with props)
trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/staticPKIX.xml (with props)
trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/staticPKIXValues.xml (with props)
Modified:
trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/StaticPKIXSignatureParser.java
Modified: trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/StaticPKIXSignatureParser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/StaticPKIXSignatureParser.java?rev=6232&r1=6231&r2=6232&view=diff
==============================================================================
--- trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/StaticPKIXSignatureParser.java (original)
+++ trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/security/trustengine/StaticPKIXSignatureParser.java Sat Jul 5 11:22:41 2014
@@ -17,21 +17,21 @@
package net.shibboleth.idp.profile.spring.relyingparty.security.trustengine;
-import java.util.ArrayList;
import java.util.List;
+import javax.annotation.Nonnull;
import javax.xml.namespace.QName;
+import net.shibboleth.ext.spring.util.SpringSupport;
import net.shibboleth.idp.profile.spring.relyingparty.security.SecurityNamespaceHandler;
+import net.shibboleth.utilities.java.support.xml.ElementSupport;
-import org.opensaml.xmlsec.keyinfo.impl.BasicProviderKeyInfoCredentialResolver;
-import org.opensaml.xmlsec.keyinfo.impl.KeyInfoProvider;
-import org.opensaml.xmlsec.keyinfo.impl.provider.DSAKeyValueProvider;
-import org.opensaml.xmlsec.keyinfo.impl.provider.InlineX509DataProvider;
-import org.opensaml.xmlsec.keyinfo.impl.provider.RSAKeyValueProvider;
+import org.opensaml.security.x509.impl.BasicX509CredentialNameEvaluator;
+import org.opensaml.security.x509.impl.CertPathPKIXTrustEvaluator;
+import org.opensaml.security.x509.impl.StaticPKIXValidationInformationResolver;
+import org.opensaml.xmlsec.config.DefaultSecurityConfigurationBootstrap;
import org.opensaml.xmlsec.signature.support.impl.PKIXSignatureTrustEngine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
@@ -40,30 +40,82 @@
* Parser for trust engines of type StaticPKIXKeySignature.
*/
public class StaticPKIXSignatureParser extends AbstractTrustEngineParser {
-
+
/** Schema type. */
public static final QName TYPE_NAME = new QName(SecurityNamespaceHandler.NAMESPACE, "StaticPKIXSignature");
-
- /** log.*/
- private final Logger log = LoggerFactory.getLogger(StaticPKIXSignatureParser.class);
+
+ /** Validation Information. */
+ public static final QName VALIDATION_INFO = new QName(SecurityNamespaceHandler.NAMESPACE, "ValidationInfo");
+
+ /** Trusted Names Information. */
+ public static final QName TRUSTED_NAMES = new QName(SecurityNamespaceHandler.NAMESPACE, "TrustedName");
/** {@inheritDoc} */
@Override protected Class<?> getBeanClass(Element element) {
return PKIXSignatureTrustEngine.class;
}
- /** {@inheritDoc} */
+ /**
+ * Get the definition for the {@link org.opensaml.security.x509.PKIXValidationInformationResolver}. This is
+ * constructed from the Trusted names and the Validation Info.
+ *
+ * @param element what to parse
+ * @param parserContext the context to parse inside
+ * @return the definition
+ */
+ private BeanDefinition getPKIXValidationInformationResolver(Element element,
+ @Nonnull final ParserContext parserContext) {
+
+ final List<Element> validationInfoElements = ElementSupport.getChildElements(element, VALIDATION_INFO);
+ final List<Element> trustedNameElements = ElementSupport.getChildElements(element, TRUSTED_NAMES);
+
+ BeanDefinitionBuilder builder =
+ BeanDefinitionBuilder.genericBeanDefinition(StaticPKIXValidationInformationResolver.class);
+ builder.addConstructorArgValue(SpringSupport.parseCustomElements(validationInfoElements, parserContext));
+ builder.addConstructorArgValue(SpringSupport.getElementTextContentAsManagedList(trustedNameElements));
+
[... 55 lines stripped ...]
More information about the commits
mailing list