JBoss Identity SVN: r314 - in identity-federation/trunk: identity-fed-api and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-12 10:58:49 -0500 (Thu, 12 Feb 2009)
New Revision: 314
Modified:
identity-federation/trunk/identity-bindings/.classpath
identity-federation/trunk/identity-fed-api/.classpath
Log:
add jaxws-api as dep
Modified: identity-federation/trunk/identity-bindings/.classpath
===================================================================
--- identity-federation/trunk/identity-bindings/.classpath 2009-02-12 15:46:04 UTC (rev 313)
+++ identity-federation/trunk/identity-bindings/.classpath 2009-02-12 15:58:49 UTC (rev 314)
@@ -28,5 +28,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/identity-fed-core"/>
<classpathentry combineaccessrules="false" kind="src" path="/identity-fed-model"/>
<classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxws/jaxws-api/2.1.1/jaxws-api-2.1.1.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: identity-federation/trunk/identity-fed-api/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-api/.classpath 2009-02-12 15:46:04 UTC (rev 313)
+++ identity-federation/trunk/identity-fed-api/.classpath 2009-02-12 15:58:49 UTC (rev 314)
@@ -18,5 +18,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/identity-fed-core"/>
<classpathentry combineaccessrules="false" kind="src" path="/identity-fed-model"/>
<classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxws/jaxws-api/2.1.1/jaxws-api-2.1.1.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
15 years, 2 months
JBoss Identity SVN: r313 - in identity-federation/trunk: identity-fed-api and 2 other directories.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-12 10:46:04 -0500 (Thu, 12 Feb 2009)
New Revision: 313
Modified:
identity-federation/trunk/identity-bindings/.classpath
identity-federation/trunk/identity-fed-api/.classpath
identity-federation/trunk/identity-fed-core/.classpath
identity-federation/trunk/identity-fed-model/.classpath
Log:
correct cp
Modified: identity-federation/trunk/identity-bindings/.classpath
===================================================================
--- identity-federation/trunk/identity-bindings/.classpath 2009-02-09 21:06:37 UTC (rev 312)
+++ identity-federation/trunk/identity-bindings/.classpath 2009-02-12 15:46:04 UTC (rev 313)
@@ -1,31 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
- <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
- <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
- <classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/annotations-api/6.0.18/annotations-api-6.0.18.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/catalina/6.0.18/catalina-6.0.18.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-modeler/commons-modeler/1.1patch/commons-modeler-1.1patch.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/coyote/6.0.18/coyote-6.0.18.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
- <classpathentry kind="src" path="/jboss-identity-fed-api"/>
- <classpathentry kind="src" path="/jboss-identity-fed-core"/>
- <classpathentry kind="src" path="/jboss-identity-fed-model"/>
- <classpathentry kind="src" path="/jboss-identity-xmlsec-model"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/juli/6.0.18/juli-6.0.18.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-tomcat/naming-resources/5.5.12/naming-resources-5.5.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/servlet-api/6.0.18/servlet-api-6.0.18.jar"/>
- <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-tomcat/tomcat-http/5.5.12/tomcat-http-5.5.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-tomcat/tomcat-util/5.5.12/tomcat-util-5.5.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
-</classpath>
\ No newline at end of file
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/annotations-api/6.0.18/annotations-api-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/catalina/6.0.18/catalina-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-modeler/commons-modeler/1.1patch/commons-modeler-1.1patch.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/coyote/6.0.18/coyote-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/juli/6.0.18/juli-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-tomcat/naming-resources/5.5.12/naming-resources-5.5.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/servlet-api/6.0.18/servlet-api-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-tomcat/tomcat-http/5.5.12/tomcat-http-5.5.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-tomcat/tomcat-util/5.5.12/tomcat-util-5.5.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-api"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-model"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: identity-federation/trunk/identity-fed-api/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-api/.classpath 2009-02-09 21:06:37 UTC (rev 312)
+++ identity-federation/trunk/identity-fed-api/.classpath 2009-02-12 15:46:04 UTC (rev 313)
@@ -1,21 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
- <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
- <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
- <classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
- <classpathentry kind="src" path="/jboss-identity-fed-core"/>
- <classpathentry kind="src" path="/jboss-identity-fed-model"/>
- <classpathentry kind="src" path="/jboss-identity-xmlsec-model"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
-</classpath>
\ No newline at end of file
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-model"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: identity-federation/trunk/identity-fed-core/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-core/.classpath 2009-02-09 21:06:37 UTC (rev 312)
+++ identity-federation/trunk/identity-fed-core/.classpath 2009-02-12 15:46:04 UTC (rev 313)
@@ -1,20 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
- <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
- <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
- <classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
- <classpathentry kind="src" path="/jboss-identity-fed-model"/>
- <classpathentry kind="src" path="/jboss-identity-xmlsec-model"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
-</classpath>
\ No newline at end of file
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-model"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Modified: identity-federation/trunk/identity-fed-model/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-model/.classpath 2009-02-09 21:06:37 UTC (rev 312)
+++ identity-federation/trunk/identity-fed-model/.classpath 2009-02-12 15:46:04 UTC (rev 313)
@@ -1,20 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
- <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
- <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
- <classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
- <classpathentry kind="src" path="/jboss-identity-xmlsec-model"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xalan/serializer/2.7.0.patch01-brew/serializer-2.7.0.patch01-brew.jar"/>
- <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
-</classpath>
\ No newline at end of file
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-xalan/serializer/2.7.0.patch01-brew/serializer-2.7.0.patch01-brew.jar"/>
+ <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
15 years, 2 months
JBoss Identity SVN: r312 - idm/trunk/idm.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-09 16:06:37 -0500 (Mon, 09 Feb 2009)
New Revision: 312
Modified:
idm/trunk/idm/.classpath
Log:
fix eclipse dep
Modified: idm/trunk/idm/.classpath
===================================================================
--- idm/trunk/idm/.classpath 2009-02-09 18:47:40 UTC (rev 311)
+++ idm/trunk/idm/.classpath 2009-02-09 21:06:37 UTC (rev 312)
@@ -11,7 +11,7 @@
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.3.1.GA/hibernate-annotations-3.3.1.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/sun-opends/OpenDS/1.0.0/OpenDS-1.0.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-entitymanager/3.3.1.ga/hibernate-entitymanager-3.3.1.ga.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate/3.2.4.ga/hibernate-3.2.4.ga.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/cache/jbosscache-core/3.0.2.GA/jbosscache-core-3.0.2.GA.jar"/>
<classpathentry kind="output" path="target/eclipse-classes"/>
15 years, 2 months
JBoss Identity SVN: r311 - in identity-federation/trunk: identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss and 9 other directories.
by jboss-identity-commits@lists.jboss.org
Author: sguilhen(a)redhat.com
Date: 2009-02-09 13:47:40 -0500 (Mon, 09 Feb 2009)
New Revision: 311
Added:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossRequestHandler.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossSTS.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/STSConfiguration.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityToken.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityTokenProvider.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityTokenService.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustConstants.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustException.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustRequestContext.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustRequestHandler.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustServiceFactory.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustUtil.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/BaseRequestSecurityToken.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/BaseRequestSecurityTokenResponse.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityToken.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenCollection.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenResponse.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenResponseCollection.java
Modified:
identity-federation/trunk/identity-bindings/.classpath
identity-federation/trunk/identity-bindings/.project
identity-federation/trunk/identity-fed-api/.classpath
identity-federation/trunk/identity-fed-api/.project
identity-federation/trunk/identity-fed-api/pom.xml
identity-federation/trunk/identity-fed-core/.classpath
identity-federation/trunk/identity-fed-core/.project
identity-federation/trunk/identity-fed-model/.classpath
identity-federation/trunk/identity-fed-model/.project
identity-federation/trunk/identity-fed-model/src/test/java/org/jboss/test/identity/federation/ws/trust/UnmarshallingTestCase.java
identity-federation/trunk/identity-xmlsecmodel/.classpath
identity-federation/trunk/identity-xmlsecmodel/.project
Log:
Adding initial WS-Trust implementation classes.
Modified: identity-federation/trunk/identity-bindings/.classpath
===================================================================
--- identity-federation/trunk/identity-bindings/.classpath 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-bindings/.classpath 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,27 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="src" path="src/test/resources"/>
- <classpathentry kind="src" path="src/test/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/catalina/6.0.18/catalina-6.0.18.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
- <classpathentry kind="var" path="M2_REPO/apache-tomcat/tomcat-util/5.5.12/tomcat-util-5.5.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-modeler/commons-modeler/1.1patch/commons-modeler-1.1patch.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/coyote/6.0.18/coyote-6.0.18.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-tomcat/tomcat-http/5.5.12/tomcat-http-5.5.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-tomcat/naming-resources/5.5.12/naming-resources-5.5.12.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-api"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-core"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-model"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/identity/jboss-identity-xmlsec-model/1.0.0-SNAPSHOT/jboss-identity-xmlsec-model-1.0.0-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-xacml/2.0.2.SP1/jboss-xacml-2.0.2.SP1.jar" sourcepath="/M2_REPO/org/jboss/security/jboss-xacml/2.0.2.SP1/jboss-xacml-2.0.2.SP1-sources.jar"/>
- <classpathentry kind="output" path="target-eclipse/"/>
-</classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/annotations-api/6.0.18/annotations-api-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/catalina/6.0.18/catalina-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-modeler/commons-modeler/1.1patch/commons-modeler-1.1patch.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/coyote/6.0.18/coyote-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+ <classpathentry kind="src" path="/jboss-identity-fed-api"/>
+ <classpathentry kind="src" path="/jboss-identity-fed-core"/>
+ <classpathentry kind="src" path="/jboss-identity-fed-model"/>
+ <classpathentry kind="src" path="/jboss-identity-xmlsec-model"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/juli/6.0.18/juli-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-tomcat/naming-resources/5.5.12/naming-resources-5.5.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/tomcat/servlet-api/6.0.18/servlet-api-6.0.18.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-tomcat/tomcat-http/5.5.12/tomcat-http-5.5.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-tomcat/tomcat-util/5.5.12/tomcat-util-5.5.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
+</classpath>
\ No newline at end of file
Modified: identity-federation/trunk/identity-bindings/.project
===================================================================
--- identity-federation/trunk/identity-bindings/.project 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-bindings/.project 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,17 +1,18 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>identity-bindings</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+ <name>jboss-identity-bindings</name>
+ <comment>JBoss Identity OpenSAML contains the foundation for Federated Identity Needs.</comment>
+ <projects>
+ <project>jboss-identity-fed-api</project>
+ <project>jboss-identity-fed-core</project>
+ <project>jboss-identity-fed-model</project>
+ <project>jboss-identity-xmlsec-model</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossRequestHandler.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossRequestHandler.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossRequestHandler.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.bindings.jboss.trust;
+
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.identity.federation.api.wstrust.STSConfiguration;
+import org.jboss.identity.federation.api.wstrust.SecurityTokenProvider;
+import org.jboss.identity.federation.api.wstrust.WSTrustException;
+import org.jboss.identity.federation.api.wstrust.WSTrustRequestContext;
+import org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler;
+import org.jboss.identity.federation.api.wstrust.WSTrustUtil;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenResponse;
+import org.jboss.identity.federation.ws.policy.AppliesTo;
+import org.jboss.identity.federation.ws.trust.RequestedSecurityTokenType;
+
+/**
+ * <p>
+ * Default implementation of the {@code WSTrustRequestHandler} interface. It creates the request context containing the
+ * original WS-Trust request as well as any information that may be relevant to the token processing, and delegates the
+ * actual token handling processing to the appropriate {@code SecurityTokenProvider}.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class JBossRequestHandler implements WSTrustRequestHandler
+{
+
+ private STSConfiguration configuration;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#initialize(org.jboss.identity.federation.api.wstrust.STSConfiguration)
+ */
+ public void initialize(STSConfiguration configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#issue(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
+ * javax.xml.ws.handler.MessageContext)
+ */
+ public RequestSecurityTokenResponse issue(RequestSecurityToken request, MessageContext context)
+ throws WSTrustException
+ {
+ SecurityTokenProvider provider = null;
+
+ // first try to obtain the security token provider using the applies-to contents.
+ AppliesTo appliesTo = request.getAppliesTo();
+ if(appliesTo != null)
+ {
+ String serviceName = WSTrustUtil.parseAppliesTo(appliesTo);
+ if(serviceName != null)
+ provider = this.configuration.getProviderForService(serviceName);
+ }
+ // if applies-to is not available or if no provider was found for the service, use the token type.
+ else if(request.getTokenType() != null && provider == null)
+ {
+ provider = this.configuration.getProviderForTokenType(request.getTokenType().toString());
+ }
+ else if(request.getTokenType() == null)
+ throw new WSTrustException("Either AppliesTo or TokenType must be present in a security token request");
+
+ if(provider != null)
+ {
+ // create the request context and delegate token generation to the provider.
+ WSTrustRequestContext requestContext = new WSTrustRequestContext(request);
+
+ // TODO: add a lifetime to the request when one hasn't been specified.
+ provider.issueToken(requestContext);
+
+ // construct the ws-trust security token response.
+ RequestedSecurityTokenType requestedSecurityToken = new RequestedSecurityTokenType();
+ requestedSecurityToken.setAny(requestContext.getSecurityToken());
+
+ // TODO: create proof token and encrypt the token if needed
+
+ RequestSecurityTokenResponse response = new RequestSecurityTokenResponse();
+ if(request.getContext() != null)
+ response.setContext(request.getContext());
+
+ // TODO: obtain the token type even when the request doesn't have one.
+ response.setTokenType(request.getTokenType());
+ response.setAppliesTo(appliesTo);
+ response.setRequestedSecurityToken(requestedSecurityToken);
+ return response;
+ }
+ else
+ throw new WSTrustException("Unable to find a token provider for the token request");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#renew(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
+ * javax.xml.ws.handler.MessageContext)
+ */
+ public RequestSecurityTokenResponse renew(RequestSecurityToken request, MessageContext context)
+ throws WSTrustException
+ {
+ // TODO: implement renew logic.
+ throw new UnsupportedOperationException();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#validate(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
+ * javax.xml.ws.handler.MessageContext)
+ */
+ public RequestSecurityTokenResponse validate(RequestSecurityToken request, MessageContext context)
+ throws WSTrustException
+ {
+ // TODO: implement validate logic.
+ throw new UnsupportedOperationException();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#cancel(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
+ * javax.xml.ws.handler.MessageContext)
+ */
+ public RequestSecurityTokenResponse cancel(RequestSecurityToken request, MessageContext context)
+ throws WSTrustException
+ {
+ // TODO: implement cancel logic.
+ throw new UnsupportedOperationException();
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossSTS.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossSTS.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossSTS.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,163 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.bindings.jboss.trust;
+
+import javax.annotation.Resource;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.identity.federation.api.wstrust.STSConfiguration;
+import org.jboss.identity.federation.api.wstrust.SecurityTokenService;
+import org.jboss.identity.federation.api.wstrust.WSTrustConstants;
+import org.jboss.identity.federation.api.wstrust.WSTrustException;
+import org.jboss.identity.federation.api.wstrust.WSTrustJAXBFactory;
+import org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler;
+import org.jboss.identity.federation.api.wstrust.WSTrustServiceFactory;
+import org.jboss.identity.federation.api.wstrust.protocol.BaseRequestSecurityToken;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenCollection;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenResponse;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenResponseCollection;
+
+/**
+ * <p>
+ * Default implementation of the {@code SecurityTokenService} interface.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+@WebServiceProvider
+@ServiceMode(value = Service.Mode.PAYLOAD)
+public class JBossSTS implements SecurityTokenService
+{
+
+ @Resource
+ protected WebServiceContext context;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.identity.federation.api.wstrust.SecurityTokenService#invoke(javax.xml.transform.Source)
+ */
+ public Source invoke(Source request)
+ {
+ BaseRequestSecurityToken baseRequest = WSTrustJAXBFactory.getInstance().parseRequestSecurityToken(request);
+ if (baseRequest instanceof RequestSecurityToken)
+ return this.handleTokenRequest((RequestSecurityToken) baseRequest);
+ else if (baseRequest instanceof RequestSecurityTokenCollection)
+ return this.handleTokenRequestCollection((RequestSecurityTokenCollection) baseRequest);
+ else
+ throw new WebServiceException("Invalid security token request");
+ }
+
+ /**
+ * <p>
+ * Process a security token request.
+ * </p>
+ *
+ * @param request a {@code RequestSecurityToken} instance that contains the request information.
+ * @return a {@code Source} instance representing the marshalled response.
+ */
+ protected Source handleTokenRequest(RequestSecurityToken request)
+ {
+ WSTrustRequestHandler handler = WSTrustServiceFactory.getInstance().createRequestHandler(this.getConfiguration());
+ String requestType = request.getRequestType().toString();
+
+ try
+ {
+ if (requestType.equals(WSTrustConstants.ISSUE_REQUEST))
+ return this.marshallResponse(handler.issue(request, this.context.getMessageContext()));
+ else if (requestType.equals(WSTrustConstants.RENEW_REQUEST))
+ return this.marshallResponse(handler.renew(request, this.context.getMessageContext()));
+ else if (requestType.equals(WSTrustConstants.CANCEL_REQUEST))
+ return this.marshallResponse(handler.cancel(request, this.context.getMessageContext()));
+ else if (requestType.equals(WSTrustConstants.VALIDATE_REQUEST))
+ return this.marshallResponse(handler.validate(request, this.context.getMessageContext()));
+ else
+ throw new WSTrustException("Invalid request type: " + requestType);
+ }
+ catch (WSTrustException we)
+ {
+ throw new WebServiceException(we.getMessage(), we);
+ }
+ }
+
+ /**
+ * <p>
+ * Process a collection of security token requests.
+ * </p>
+ *
+ * @param requestCollection a {@code RequestSecurityTokenCollection} containing the various requests information.
+ * @return a {@code Source} instance representing the marshalled response.
+ */
+ protected Source handleTokenRequestCollection(RequestSecurityTokenCollection requestCollection)
+ {
+ // TODO: implement multiple token request handling code.
+ return null;
+ }
+
+ /**
+ * <p>
+ * Marshalls the specified {@code RequestSecurityTokenResponse} into a {@code Source} instance.
+ * </p>
+ *
+ * @param response the {@code RequestSecurityTokenResponse} to be marshalled.
+ * @return the resulting {@code Source} instance.
+ */
+ protected Source marshallResponse(RequestSecurityTokenResponse response)
+ {
+ // add the single response to a RequestSecurityTokenResponse collection, as per the specification.
+ RequestSecurityTokenResponseCollection responseCollection = new RequestSecurityTokenResponseCollection();
+ responseCollection.addRequestSecurityTokenResponse(response);
+ return this.marshallResponse(responseCollection);
+ }
+
+ /**
+ * <p>
+ * Marshalls the specified {@code RequestSecurityTokenResponseCollection} into a {@code Source} instance.
+ * </p>
+ *
+ * @param responseCollection the {@code RequestSecurityTokenResponseCollection} to be marshalled.
+ * @return the resulting {@code Source} instance.
+ */
+ protected Source marshallResponse(RequestSecurityTokenResponseCollection responseCollection)
+ {
+ return WSTrustJAXBFactory.getInstance().marshallRequestSecurityTokenResponse(responseCollection);
+ }
+
+ /**
+ * <p>
+ * Obtains the STS configuration options.
+ * </p>
+ *
+ * @return an instance of {@code STSConfiguration} containing the STS configuration properties.
+ */
+ protected STSConfiguration getConfiguration()
+ {
+ // TODO: create the configuration instance.
+ return null;
+ }
+}
Modified: identity-federation/trunk/identity-fed-api/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-api/.classpath 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-fed-api/.classpath 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,17 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="src" path="src/test/java"/>
- <classpathentry kind="src" path="src/test/resources"/>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="/M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-core"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-model"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
- <classpathentry kind="output" path="target-eclipse"/>
-</classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+ <classpathentry kind="src" path="/jboss-identity-fed-core"/>
+ <classpathentry kind="src" path="/jboss-identity-fed-model"/>
+ <classpathentry kind="src" path="/jboss-identity-xmlsec-model"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
+</classpath>
\ No newline at end of file
Modified: identity-federation/trunk/identity-fed-api/.project
===================================================================
--- identity-federation/trunk/identity-fed-api/.project 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-fed-api/.project 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>identity-fed-api</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+ <name>jboss-identity-fed-api</name>
+ <comment>JBoss Identity Federation API contains the API to be used by the users of JBoss Identity Federation.</comment>
+ <projects>
+ <project>jboss-identity-fed-core</project>
+ <project>jboss-identity-fed-model</project>
+ <project>jboss-identity-xmlsec-model</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Modified: identity-federation/trunk/identity-fed-api/pom.xml
===================================================================
--- identity-federation/trunk/identity-fed-api/pom.xml 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-fed-api/pom.xml 2009-02-09 18:47:40 UTC (rev 311)
@@ -63,6 +63,11 @@
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
+ <groupId>sun-jaxws</groupId>
+ <artifactId>jaxws-api</artifactId>
+ <version>2.1.1</version>
+ </dependency>
+ <dependency>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
<version>1.0</version>
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/STSConfiguration.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/STSConfiguration.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/STSConfiguration.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * The {@code STSConfiguration} interface allows access to the security token service (STS) configuration attributes.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public interface STSConfiguration
+{
+
+ /**
+ * <p>
+ * Obtains the unique name of the secure token service.
+ * </p>
+ *
+ * @return a {@code String} representing the STS name.
+ */
+ public String getSTSName();
+
+ /**
+ * <p>
+ * Indicates whether the issued token must be encrypted or not.
+ * </p>
+ *
+ * @return {@code true} if the issued token must be encrypted; {@code false} otherwise.
+ */
+ public boolean getEncryptIssuedToken();
+
+ /**
+ * <p>
+ * Obtains the timeout value (in milliseconds) for issued tokens.
+ * </p>
+ *
+ * @return the token timeout value.
+ */
+ public long getIssuedTokenTimeout();
+
+ /**
+ * <p>
+ * Given the name of a service provider, obtains the provider that must be used when issuing tokens to clients of
+ * that service. When requesting a token to the STS, a client can specify the service it needs the token for using
+ * the {@code AppliesTo} element. Based on the service provider name, the STS identifies the type of the token that
+ * is to be issued and then selects the appropriate token provider to handle the request.
+ * </p>
+ *
+ * @param serviceName the name of the service provider that requires a token from its clients.
+ * @return a reference to the {@code SecurityTokenProvider} that must be used in order to issue tokens to clients of
+ * the specified service.
+ */
+ public SecurityTokenProvider getProviderForService(String serviceName);
+
+ /**
+ * <p>
+ * Given a token type, obtains the token provider that should be used to handle token requests of that type. When a
+ * client doesn't specify the service provider name through the {@code AppliesTo} element, it must specify the token
+ * type through the {@code TokenType} element. The STS uses the supplied type to select the appropriate token
+ * provider.
+ * </p>
+ *
+ * @param tokenType a {@code String} representing the type of the token.
+ * @return a reference to the {@code SecurityTokenProvider} that must be used to handle token requests of the
+ * specified type.
+ */
+ public SecurityTokenProvider getProviderForTokenType(String tokenType);
+
+ /**
+ * <p>
+ * Obtains a {@code Map} that contains the non-standard configuration options.
+ * </p>
+ *
+ * @return a {@code Map<String, Object>} containing the additional configuration options.
+ */
+ public Map<String, Object> getOptions();
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityToken.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityToken.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityToken.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+/**
+ * <p>
+ * Interface that represents a security token.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public interface SecurityToken
+{
+
+ /**
+ * <p>
+ * Obtains the type of the security token.
+ * </p>
+ *
+ * @return a {@code String} representing the security token type.
+ */
+ public String getTokenType();
+
+ /**
+ * <p>
+ * Obtains the value of the security token.
+ * </p>
+ *
+ * @return an {@code Object} representing the security token value.
+ */
+ public Object getTokenValue();
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityTokenProvider.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityTokenProvider.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityTokenProvider.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+/**
+ * <p>
+ * This interface defines the methods that must be implemented by security token providers.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public interface SecurityTokenProvider
+{
+ /**
+ * <p>
+ * Generates a security token using the information contained in the specified request context and stores the
+ * newly-created token in the context itself.
+ * </p>
+ *
+ * @param context the {@code WSTrustRequestContext} to be used when generating the token.
+ * @throws WSTrustException if an error occurs while creating the security token.
+ */
+ public void issueToken(WSTrustRequestContext context) throws WSTrustException;
+
+ /**
+ * <p>
+ * Renews the security token contained in the specified request context. This method is used when a previously
+ * generated token has expired, generating a new version of the same token with different expiration semantics.
+ * </p>
+ *
+ * @param context the {@code WSTrustRequestContext} that contains the token to be renewed.
+ * @throws WSTrustException if an error occurs while renewing the security token.
+ */
+ public void renewToken(WSTrustRequestContext context) throws WSTrustException;
+
+ /**
+ * <p>
+ * Cancels the token contained in the specified request context. A security token is usually canceled when one wants
+ * to make sure that the token will not be used anymore. A security token can't be renewed once it has been canceled.
+ * </p>
+ *
+ * @param context the {@code WSTrustRequestContext} that contains the token to be canceled.
+ * @throws WSTrustException if an error occurs while canceling the security token.
+ */
+ public void cancelToken(WSTrustRequestContext context) throws WSTrustException;
+
+ /**
+ * <p>
+ * Evaluates the validity of the token contained in the specified request context and sets the result in the context
+ * itself. The result can be a status, a new token, or both.
+ * </p>
+ *
+ * @param context the {@code WSTrustRequestContext} that contains the token to be validated.
+ * @throws WSTrustException if an error occurs while validating the security token.
+ */
+ public void validateToken(WSTrustRequestContext context) throws WSTrustException;
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityTokenService.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityTokenService.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityTokenService.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+import javax.xml.transform.Source;
+import javax.xml.ws.Provider;
+
+/**
+ * <p>
+ * The {@code SecurityTokenService} (STS) interface. It extends the {@code Provider} interface so that it can be
+ * dynamically invoked (as opposed to having a service endpoint interface).
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public interface SecurityTokenService extends Provider<Source>
+{
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.xml.ws.Provider#invoke(java.lang.Object)
+ */
+ public Source invoke(Source request);
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustConstants.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustConstants.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustConstants.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+/**
+ * <p>
+ * This class defines the constants used throughout the WS-Trust implementation code.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class WSTrustConstants
+{
+ public final static String BASE_NAMESPACE = "http://docs.oasis-open.org/ws-sx/ws-trust/200512";
+
+ public final static String ISSUE_REQUEST = BASE_NAMESPACE + "/Issue";
+
+ public final static String RENEW_REQUEST = BASE_NAMESPACE + "/Renew";
+
+ public final static String CANCEL_REQUEST = BASE_NAMESPACE + "/Cancel";
+
+ public final static String VALIDATE_REQUEST = BASE_NAMESPACE + "/Validate";
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustException.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustException.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustException.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+/**
+ * <p>
+ * Exception used to convey that an error has happened when handling a WS-Trust request message.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class WSTrustException extends Exception
+{
+
+ private static final long serialVersionUID = -232066282004315310L;
+
+ /**
+ * <p>
+ * Creates an instance of {@code WSTrustException} using the specified error message.
+ * </p>
+ *
+ * @param message the error message.
+ */
+ public WSTrustException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * <p>
+ * Creates an instance of {@code WSTrustException} using the specified error message and cause.
+ * </p>
+ *
+ * @param message the error message.
+ * @param cause a {@code Throwable} representing the cause of the error.
+ */
+ public WSTrustException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,227 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.util.JAXBSource;
+import javax.xml.transform.Source;
+
+import org.jboss.identity.federation.api.wstrust.protocol.BaseRequestSecurityToken;
+import org.jboss.identity.federation.api.wstrust.protocol.BaseRequestSecurityTokenResponse;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenCollection;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenResponse;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenResponseCollection;
+import org.jboss.identity.federation.ws.trust.ObjectFactory;
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenCollectionType;
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponseCollectionType;
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponseType;
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenType;
+
+/**
+ * <p>
+ * This factory implements utility methods for converting between JAXB model objects and XML source.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class WSTrustJAXBFactory
+{
+ private static final WSTrustJAXBFactory instance = new WSTrustJAXBFactory();
+
+ private final JAXBContext context;
+
+ private final ObjectFactory factory;
+
+ /**
+ * <p>
+ * Creates the {@code WSTrustJAXBFactory} singleton instance.
+ * </p>
+ */
+ private WSTrustJAXBFactory()
+ {
+ StringBuffer packages = new StringBuffer();
+ packages.append("org.jboss.identity.federation.ws.addressing");
+ packages.append(":org.jboss.identity.federation.ws.policy");
+ packages.append(":org.jboss.identity.federation.ws.trust");
+ packages.append(":org.jboss.identity.federation.ws.wss.secext");
+ packages.append(":org.jboss.identity.federation.ws.wss.utility");
+ try
+ {
+ this.context = JAXBContext.newInstance(packages.toString());
+ this.factory = new ObjectFactory();
+ }
+ catch (JAXBException e)
+ {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * <p>
+ * Gets a reference to the singleton instance.
+ * </p>
+ *
+ * @return a reference to the {@code WSTrustJAXBFactory} instance.
+ */
+ public static WSTrustJAXBFactory getInstance()
+ {
+ return instance;
+ }
+
+ /**
+ * <p>
+ * Creates a {@code BaseRequestSecurityToken} from the specified XML source.
+ * </p>
+ *
+ * @param request the XML source containing the security token request message.
+ * @return the constructed {@code BaseRequestSecurityToken} instance. It will be an instance of
+ * {@code RequestSecurityToken} the message contains a single token request, and an instance of
+ * {@code RequestSecurityTokenCollection} if multiples requests are being made in the same message.
+ */
+ public BaseRequestSecurityToken parseRequestSecurityToken(Source request)
+ {
+ try
+ {
+ Unmarshaller unmarshaller = this.context.createUnmarshaller();
+ JAXBElement<?> element = (JAXBElement<?>) unmarshaller.unmarshal(request);
+ // is this a single token request or a collection of token requests
+ if (element.getDeclaredType().equals(RequestSecurityTokenType.class))
+ return new RequestSecurityToken((RequestSecurityTokenType) element.getValue());
+ else if (element.getDeclaredType().equals(RequestSecurityTokenCollectionType.class))
+ return new RequestSecurityTokenCollection((RequestSecurityTokenCollectionType) element.getValue());
+ else
+ throw new RuntimeException("Invalid request type: " + element.getDeclaredType());
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to unmarshall security token request", e);
+ }
+ }
+
+ /**
+ * <p>
+ * Creates a {@code BaseRequestSecurityTokenResponse} from the specified XML source.
+ * </p>
+ *
+ * @param response the XML source containing the security token response message.
+ * @return the constructed {@code BaseRequestSecurityTokenResponse} instance. It should return an instance of
+ * {@code RequestSecurityTokenResponseCollection} according to the specification, but we allow a single
+ * response to be returned in the form of a {@code RequestSecurityTokenResponse} instance.
+ */
+ public BaseRequestSecurityTokenResponse parseRequestSecurityTokenResponse(Source response)
+ {
+ try
+ {
+ Unmarshaller unmarshaller = this.context.createUnmarshaller();
+ JAXBElement<?> element = (JAXBElement<?>) unmarshaller.unmarshal(response);
+ // is this a single token response or a collection of token responses
+ if (element.getDeclaredType().equals(RequestSecurityTokenResponseType.class))
+ return new RequestSecurityTokenResponse((RequestSecurityTokenResponseType) element.getValue());
+ else if (element.getDeclaredType().equals(RequestSecurityTokenResponseCollectionType.class))
+ return new RequestSecurityTokenResponseCollection((RequestSecurityTokenResponseCollectionType) element
+ .getValue());
+ else
+ throw new RuntimeException("Invalid response type: " + element.getDeclaredType());
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Failed to unmarshall security token response", e);
+ }
+ }
+
+ /**
+ * <p>
+ * Creates a {@code javax.xml.transform.Source} from the specified request object.
+ * </p>
+ *
+ * @param request a {@code BaseRequestSecurityToken} representing the object model of the security token request.
+ * @return the constructed {@code Source} instance.
+ */
+ public Source marshallRequestSecurityToken(BaseRequestSecurityToken request)
+ {
+ JAXBElement<?> element = null;
+ if (request instanceof RequestSecurityToken)
+ {
+ RequestSecurityToken requestSecurityToken = (RequestSecurityToken) request;
+ element = this.factory.createRequestSecurityToken(requestSecurityToken.getDelegate());
+ }
+ else if (request instanceof RequestSecurityTokenCollection)
+ {
+ RequestSecurityTokenCollection collection = (RequestSecurityTokenCollection) request;
+ element = this.factory.createRequestSecurityTokenCollection(collection.getDelegate());
+ }
+ else
+ throw new RuntimeException("Failed to determine the type of the security token request");
+
+ try
+ {
+ Marshaller marshaller = this.context.createMarshaller();
+ return new JAXBSource(marshaller, element);
+ }
+ catch (JAXBException je)
+ {
+ throw new RuntimeException("Failed to marshall security token request", je);
+ }
+ }
+
+ /**
+ * <p>
+ * Creates a {@code javax.xml.transform.Source} from the specified response object.
+ * </p>
+ *
+ * @param response a {@code BaseRequestSecurityTokenResponse} representing the object model of the security token
+ * response.
+ * @return the constructed {@code Source} instance.
+ */
+ public Source marshallRequestSecurityTokenResponse(BaseRequestSecurityTokenResponse response)
+ {
+ JAXBElement<?> element = null;
+ if (response instanceof RequestSecurityTokenResponse)
+ {
+ RequestSecurityTokenResponse requestSecurityTokenResponse = (RequestSecurityTokenResponse) response;
+ element = this.factory.createRequestSecurityTokenResponse(requestSecurityTokenResponse.getDelegate());
+ }
+ else if (response instanceof RequestSecurityTokenResponseCollection)
+ {
+ RequestSecurityTokenResponseCollection collection = (RequestSecurityTokenResponseCollection) response;
+ element = this.factory.createRequestSecurityTokenResponseCollection(collection.getDelegate());
+ }
+ else
+ throw new RuntimeException("Failed to determine the type of the security token response");
+
+ try
+ {
+ Marshaller marshaller = this.context.createMarshaller();
+ return new JAXBSource(marshaller, element);
+ }
+ catch (JAXBException je)
+ {
+ throw new RuntimeException("Failed to marshall security token request", je);
+ }
+ }
+
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustRequestContext.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustRequestContext.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustRequestContext.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken;
+
+/**
+ * <p>
+ * The {@code WSTrustRequestContext} contains all the information that is relevant for the security token request
+ * processing.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class WSTrustRequestContext
+{
+
+ private final RequestSecurityToken request;
+
+ private SecurityToken securityToken;
+
+ /**
+ * <p>
+ * Creates an instance of {@code WSTrustRequestContext} using the specified request.
+ * </p>
+ *
+ * @param request a {@code RequestSecurityToken} object that contains the information about the security token
+ * request.
+ */
+ public WSTrustRequestContext(RequestSecurityToken request)
+ {
+ this.request = request;
+ }
+
+ /**
+ * <p>
+ * Obtains the object the contains the information about the security token request.
+ * </p>
+ *
+ * @return a reference to the {@code RequestSecurityToken} instance.
+ */
+ public RequestSecurityToken getRequestSecurityToken()
+ {
+ return this.request;
+ }
+
+ /**
+ * <p>
+ * Obtains the security token contained in this context.
+ * </p>
+ *
+ * @return a reference to the {@code SecurityToken} instance.
+ */
+ public SecurityToken getSecurityToken()
+ {
+ return this.securityToken;
+ }
+
+ /**
+ * <p>
+ * Sets the security token in the context.
+ * </p>
+ *
+ * @param token the {@code SecurityToken} instance to be set.
+ */
+ public void setSecurityToken(SecurityToken token)
+ {
+ this.securityToken = token;
+ }
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustRequestHandler.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustRequestHandler.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustRequestHandler.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenResponse;
+
+/**
+ * <p>
+ * The {@code WSTrustRequestHandler} interface defines the methods that will be responsible for handling the different
+ * types of WS-Trust request messages.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public interface WSTrustRequestHandler
+{
+
+ /**
+ * <p>
+ * Initializes the concrete {@code WSTrustRequestHandler} instance.
+ * </p>
+ *
+ * @param configuration a reference to object that contains the STS configuration.
+ */
+ public void initialize(STSConfiguration configuration);
+
+ /**
+ * <p>
+ * Generates a security token according to the information specified in the request message and returns the created
+ * token in the response.
+ * </p>
+ *
+ * @param request the security token request message.
+ * @param context the context of the token request message. The context provides information that may be relevant to
+ * the request processing, such as the subject of the caller.
+ * @return a {@code RequestSecurityTokenResponse} containing the generated token.
+ * @throws WSTrustException if an error occurs while handling the request message.
+ */
+ public RequestSecurityTokenResponse issue(RequestSecurityToken request, MessageContext context)
+ throws WSTrustException;
+
+ /**
+ * <p>
+ * Renews the security token as specified in the request message, returning the renewed token in the response.
+ * </p>
+ *
+ * @param request the request message that contains the token to be renewed.
+ * @param context the context of the token request message. The context provides information that may be relevant to
+ * the request processing, such as the subject of the caller.
+ * @return a {@code RequestSecurityTokenResponse} containing the renewed token.
+ * @throws WSTrustException if an error occurs while handling the renewal process.
+ */
+ public RequestSecurityTokenResponse renew(RequestSecurityToken request, MessageContext context)
+ throws WSTrustException;
+
+ /**
+ * <p>
+ * Cancels the security token as specified in the request message.
+ * </p>
+ *
+ * @param request the request message that contains the token to be canceled.
+ * @param context the context of the token request message. The context provides information that may be relevant to
+ * the request processing, such as the subject of the caller.
+ * @return a {@code RequestSecurityTokenResponse} indicating whether the token has been canceled or not.
+ * @throws WSTrustException if an error occurs while handling the cancellation process.
+ */
+ public RequestSecurityTokenResponse cancel(RequestSecurityToken request, MessageContext context)
+ throws WSTrustException;
+
+ /**
+ * <p>
+ * Validates the security token as specified in the request message.
+ * </p>
+ *
+ * @param request the request message that contains the token to be validated.
+ * @param context the context of the token request message. The context provides information that may be relevant to
+ * the request processing, such as the subject of the caller.
+ * @return a {@code RequestSecurityTokenResponse} containing the validation status or a new token.
+ * @throws WSTrustException if an error occurs while handling the validation process.
+ */
+ public RequestSecurityTokenResponse validate(RequestSecurityToken request, MessageContext context)
+ throws WSTrustException;
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustServiceFactory.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustServiceFactory.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustServiceFactory.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+/**
+ * <p>
+ * Factory class used for instantiating pluggable services, such as the {@code WSTrustRequestHandler} and
+ * {@code SecurityTokenProvider} implementations.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class WSTrustServiceFactory
+{
+
+ private static final WSTrustServiceFactory factory = new WSTrustServiceFactory();
+
+ /**
+ * <p>
+ * Creates the {@code WSTrustConfigurationFactory} singleton instance.
+ * </p>
+ */
+ private WSTrustServiceFactory()
+ {
+ }
+
+ /**
+ * <p>
+ * Obtains a reference to the singleton instance.
+ * </p>
+ *
+ * @return the {@code WSTrustConfigurationFactory} singleton.
+ */
+ public static WSTrustServiceFactory getInstance()
+ {
+ return factory;
+ }
+
+ public WSTrustRequestHandler createRequestHandler(STSConfiguration configuration)
+ {
+ // TODO: obtain the actual WSTrustRequestHandler implementation class from the configuration.
+ String handlerClassName = "org.jboss.identity.federation.api.wstrust.JBossWSTrustRequestHandler";
+ try
+ {
+ Class<?> handlerClass = null;
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null)
+ handlerClass = Class.forName(handlerClassName);
+ else
+ handlerClass = loader.loadClass(handlerClassName);
+
+ // TODO: instantiate the class using a privileged block.
+ WSTrustRequestHandler handler = (WSTrustRequestHandler) handlerClass.newInstance();
+ handler.initialize(configuration);
+ return handler;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustUtil.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustUtil.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustUtil.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust;
+
+import javax.xml.bind.JAXBElement;
+
+import org.jboss.identity.federation.ws.addressing.EndpointReferenceType;
+import org.jboss.identity.federation.ws.policy.AppliesTo;
+
+/**
+ * <p>
+ * Utility class that provides methods for parsing/creating WS-Trust elements.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class WSTrustUtil
+{
+
+ /**
+ * <p>
+ * Parses the contents of the {@code AppliesTo} element and returns the address the uniquely identify the service
+ * provider.
+ * </p>
+ *
+ * @param appliesTo the {@code AppliesTo} instance to be parsed.
+ * @return the address of the service provider.
+ */
+ public static String parseAppliesTo(AppliesTo appliesTo)
+ {
+ EndpointReferenceType reference = null;
+ for (Object obj : appliesTo.getAny())
+ {
+ if (obj instanceof EndpointReferenceType)
+ reference = (EndpointReferenceType) obj;
+ else if (obj instanceof JAXBElement)
+ {
+ JAXBElement<?> element = (JAXBElement<?>) obj;
+ if (element.getName().getLocalPart().equalsIgnoreCase("EndpointReference"))
+ reference = (EndpointReferenceType) element.getValue();
+ }
+
+ if (reference != null && reference.getAddress() != null)
+ return reference.getAddress().toString();
+ }
+ return null;
+ }
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/BaseRequestSecurityToken.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/BaseRequestSecurityToken.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/BaseRequestSecurityToken.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust.protocol;
+
+/**
+ * <p>
+ * Marker interface for the request security token types.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public interface BaseRequestSecurityToken
+{
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/BaseRequestSecurityTokenResponse.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/BaseRequestSecurityTokenResponse.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/BaseRequestSecurityTokenResponse.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust.protocol;
+
+/**
+ * <p>
+ * Marker interface for the security token response types.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public interface BaseRequestSecurityTokenResponse
+{
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityToken.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityToken.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityToken.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,1001 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust.protocol;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+
+import org.jboss.identity.federation.ws.addressing.EndpointReferenceType;
+import org.jboss.identity.federation.ws.policy.AppliesTo;
+import org.jboss.identity.federation.ws.policy.Policy;
+import org.jboss.identity.federation.ws.policy.PolicyReference;
+import org.jboss.identity.federation.ws.trust.AllowPostdatingType;
+import org.jboss.identity.federation.ws.trust.ClaimsType;
+import org.jboss.identity.federation.ws.trust.DelegateToType;
+import org.jboss.identity.federation.ws.trust.EncryptionType;
+import org.jboss.identity.federation.ws.trust.EntropyType;
+import org.jboss.identity.federation.ws.trust.LifetimeType;
+import org.jboss.identity.federation.ws.trust.ObjectFactory;
+import org.jboss.identity.federation.ws.trust.OnBehalfOfType;
+import org.jboss.identity.federation.ws.trust.ProofEncryptionType;
+import org.jboss.identity.federation.ws.trust.RenewingType;
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenType;
+import org.jboss.identity.federation.ws.trust.UseKeyType;
+
+/**
+ * <p>
+ * This class represents a WS-Trust {@code RequestSecurityToken}. It wraps the JAXB representation of the security
+ * token request and offers a series of getter/setter methods that make it easy to work with elements that are
+ * represented by the {@code Any} XML type.
+ * </p>
+ * <p>
+ * The following shows the intended content model of a {@code RequestSecurityToken}:
+ *
+ * <pre>
+ * <xs:element ref='wst:TokenType' minOccurs='0' />
+ * <xs:element ref='wst:RequestType' />
+ * <xs:element ref='wsp:AppliesTo' minOccurs='0' />
+ * <xs:element ref='wst:Claims' minOccurs='0' />
+ * <xs:element ref='wst:Entropy' minOccurs='0' />
+ * <xs:element ref='wst:Lifetime' minOccurs='0' />
+ * <xs:element ref='wst:AllowPostdating' minOccurs='0' />
+ * <xs:element ref='wst:Renewing' minOccurs='0' />
+ * <xs:element ref='wst:OnBehalfOf' minOccurs='0' />
+ * <xs:element ref='wst:Issuer' minOccurs='0' />
+ * <xs:element ref='wst:AuthenticationType' minOccurs='0' />
+ * <xs:element ref='wst:KeyType' minOccurs='0' />
+ * <xs:element ref='wst:KeySize' minOccurs='0' />
+ * <xs:element ref='wst:SignatureAlgorithm' minOccurs='0' />
+ * <xs:element ref='wst:Encryption' minOccurs='0' />
+ * <xs:element ref='wst:EncryptionAlgorithm' minOccurs='0' />
+ * <xs:element ref='wst:CanonicalizationAlgorithm' minOccurs='0' />
+ * <xs:element ref='wst:ProofEncryption' minOccurs='0' />
+ * <xs:element ref='wst:UseKey' minOccurs='0' />
+ * <xs:element ref='wst:SignWith' minOccurs='0' />
+ * <xs:element ref='wst:EncryptWith' minOccurs='0' />
+ * <xs:element ref='wst:DelegateTo' minOccurs='0' />
+ * <xs:element ref='wst:Forwardable' minOccurs='0' />
+ * <xs:element ref='wst:Delegatable' minOccurs='0' />
+ * <xs:element ref='wsp:Policy' minOccurs='0' />
+ * <xs:element ref='wsp:PolicyReference' minOccurs='0' />
+ * <xs:any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded' />
+ * </pre>
+ *
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class RequestSecurityToken implements BaseRequestSecurityToken
+{
+
+ private final RequestSecurityTokenType delegate;
+
+ private URI tokenType;
+
+ private URI requestType;
+
+ private AppliesTo appliesTo;
+
+ private ClaimsType claims;
+
+ private EntropyType entropy;
+
+ private LifetimeType lifetime;
+
+ private AllowPostdatingType allowPostDating;
+
+ private RenewingType renewing;
+
+ private OnBehalfOfType onBehalfOf;
+
+ private EndpointReferenceType issuer;
+
+ private URI authenticationType;
+
+ private URI keyType;
+
+ private long keySize;
+
+ private URI signatureAlgorithm;
+
+ private EncryptionType encryption;
+
+ private URI encryptionAlgorithm;
+
+ private URI canonicalizationAlgorithm;
+
+ private ProofEncryptionType proofEncryption;
+
+ private UseKeyType useKey;
+
+ private URI signWith;
+
+ private URI encryptWith;
+
+ private DelegateToType delegateTo;
+
+ private boolean forwardable;
+
+ private boolean delegatable;
+
+ private Policy policy;
+
+ private PolicyReference policyReference;
+
+ private final List<Object> extensionElements = new ArrayList<Object>();
+
+ private final ObjectFactory factory = new ObjectFactory();
+
+ /**
+ * <p>
+ * Creates an instance of {@code RequestSecurityToken}.
+ * </p>
+ */
+ public RequestSecurityToken()
+ {
+ this.delegate = new RequestSecurityTokenType();
+ }
+
+ /**
+ * <p>
+ * Creates an instance of {@code RequestSecurityToken} using the specified delegate.
+ * </p>
+ *
+ * @param delegate the JAXB {@code RequestSecurityTokenType} that represents a WS-Trust token request.
+ */
+ public RequestSecurityToken(RequestSecurityTokenType delegate)
+ {
+ this.delegate = delegate;
+ // parse the delegate's Any contents.
+ try
+ {
+ for (Object obj : this.delegate.getAny())
+ {
+ if (obj instanceof AppliesTo)
+ {
+ this.appliesTo = (AppliesTo) obj;
+ }
+ else if (obj instanceof Policy)
+ {
+ this.policy = (Policy) obj;
+ }
+ else if (obj instanceof PolicyReference)
+ {
+ this.policyReference = (PolicyReference) obj;
+ }
+ else if (obj instanceof JAXBElement)
+ {
+ JAXBElement<?> element = (JAXBElement<?>) obj;
+ String localName = element.getName().getLocalPart();
+ if (localName.equalsIgnoreCase("TokenType"))
+ this.tokenType = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("RequestType"))
+ this.requestType = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("Claims"))
+ this.claims = (ClaimsType) element.getValue();
+ else if (localName.equalsIgnoreCase("Entropy"))
+ this.entropy = (EntropyType) element.getValue();
+ else if (localName.equalsIgnoreCase("Lifetime"))
+ this.lifetime = (LifetimeType) element.getValue();
+ else if (localName.equalsIgnoreCase("AllowPostdating"))
+ this.allowPostDating = (AllowPostdatingType) element.getValue();
+ else if (localName.equalsIgnoreCase("Renewing"))
+ this.renewing = (RenewingType) element.getValue();
+ else if (localName.equalsIgnoreCase("OnBehalfOf"))
+ this.onBehalfOf = (OnBehalfOfType) element.getValue();
+ else if (localName.equalsIgnoreCase("Issuer"))
+ this.issuer = (EndpointReferenceType) element.getValue();
+ else if (localName.equalsIgnoreCase("AuthenticationType"))
+ this.authenticationType = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("KeyType"))
+ this.keyType = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("KeySize"))
+ this.keySize = (Long) element.getValue();
+ else if (localName.equalsIgnoreCase("SignatureAlgorithm"))
+ this.signatureAlgorithm = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("Encryption"))
+ this.encryption = (EncryptionType) element.getValue();
+ else if (localName.equalsIgnoreCase("EntropyAlgorithm"))
+ this.encryptionAlgorithm = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("CanonicalizationAlgorithm"))
+ this.canonicalizationAlgorithm = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("ProofEncryption"))
+ this.proofEncryption = (ProofEncryptionType) element.getValue();
+ else if (localName.equalsIgnoreCase("UseKey"))
+ this.useKey = (UseKeyType) element.getValue();
+ else if (localName.equalsIgnoreCase("SignWith"))
+ this.signWith = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("EncryptWith"))
+ this.encryptWith = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("DelegateTo"))
+ this.delegateTo = (DelegateToType) element.getValue();
+ else if (localName.equalsIgnoreCase("Forwardable"))
+ this.forwardable = (Boolean) element.getValue();
+ else if (localName.equalsIgnoreCase("Delegatable"))
+ this.delegatable = (Boolean) element.getValue();
+ else
+ this.extensionElements.add(element.getValue());
+ }
+ else
+ {
+ this.extensionElements.add(obj);
+ }
+ }
+ }
+ catch (URISyntaxException e)
+ {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code URI} that identifies the token type.
+ * </p>
+ *
+ * @return a {@code URI} that represents the token type.
+ */
+ public URI getTokenType()
+ {
+ return tokenType;
+ }
+
+ /**
+ * <p>
+ * Sets the token type.
+ * </p>
+ *
+ * @param tokenType a {@code URI} that identifies the token type.
+ */
+ public void setTokenType(URI tokenType)
+ {
+ this.tokenType = tokenType;
+ this.delegate.getAny().add(this.factory.createTokenType(tokenType.toString()));
+
+ }
+
+ /**
+ * <p>
+ * Obtains the request type.
+ * </p>
+ *
+ * @return a {@code URI} that identifies the request type.
+ */
+ public URI getRequestType()
+ {
+ return requestType;
+ }
+
+ /**
+ * <p>
+ * Sets the request type. The type must be one of the request types described in the WS-Trust specification.
+ * </p>
+ *
+ * @param requestType a {@code URI} that identifies the request type.
+ */
+ public void setRequestType(URI requestType)
+ {
+ this.requestType = requestType;
+ this.delegate.getAny().add(this.factory.createRequestType(requestType.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code AppliesTo} value of this request. The {@code AppliesTo} object identifies the service provider
+ * (web service) that requires a token to be presented by clients. A STS uses this object to find the type of the
+ * token that is accepted by the service provider so that it can issue appropriate tokens to clients.
+ * </p>
+ *
+ * @return the reference to the {@code AppliesTo} object.
+ */
+ public AppliesTo getAppliesTo()
+ {
+ return appliesTo;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code AppliesTo} value of this request. The {@code AppliesTo} object identifies the service provider
+ * (web service) that requires a token to be presented by clients. A STS uses this object to find the type of the
+ * token that is accepted by the service provider so that it can issue appropriate tokens to clients.
+ * </p>
+ *
+ * @param appliesTo a reference to the {@code AppliesTo} object that identifies the service provider.
+ */
+ public void setAppliesTo(AppliesTo appliesTo)
+ {
+ this.appliesTo = appliesTo;
+ this.delegate.getAny().add(appliesTo);
+ }
+
+ /**
+ * <p>
+ * Obtains the set of claims of this request.
+ * </p>
+ *
+ * @return a reference to the {@code ClaimsType} object that represents the request's claims.
+ */
+ public ClaimsType getClaims()
+ {
+ return claims;
+ }
+
+ /**
+ * <p>
+ * Sets the claims of this request.
+ * </p>
+ *
+ * @param claims the {@code ClaimsType} object that represents the claims to be set.
+ */
+ public void setClaims(ClaimsType claims)
+ {
+ this.claims = claims;
+ this.delegate.getAny().add(this.factory.createClaims(claims));
+ }
+
+ /**
+ * <p>
+ * Obtains the entropy that will be used in creating the key.
+ * </p>
+ *
+ * @return a reference to the {@code EntropyType} that represents the entropy.
+ */
+ public EntropyType getEntropy()
+ {
+ return entropy;
+ }
+
+ /**
+ * <p>
+ * Sets the entropy that must be used when creating the key.
+ * </p>
+ *
+ * @param entropy the {@code EntropyType} representing the entropy to be set.
+ */
+ public void setEntropy(EntropyType entropy)
+ {
+ this.entropy = entropy;
+ this.delegate.getAny().add(this.factory.createEntropy(entropy));
+ }
+
+ /**
+ * <p>
+ * Obtains the desired lifetime of the requested token.
+ * </p>
+ *
+ * @return a reference to the {@code LifetimeType} that represents the lifetime.
+ */
+ public LifetimeType getLifetime()
+ {
+ return lifetime;
+ }
+
+ /**
+ * <p>
+ * Sets the desired lifetime of the requested token.
+ * </p>
+ *
+ * @param lifetime the {@code LifetimeType} object representing the lifetime to be set.
+ */
+ public void setLifetime(LifetimeType lifetime)
+ {
+ this.lifetime = lifetime;
+ this.delegate.getAny().add(this.factory.createLifetime(lifetime));
+ }
+
+ /**
+ * <p>
+ * Checks whether a request for a postdated token should be allowed or not.
+ * </p>
+ *
+ * @return {@code null} if the token can't have a future lifetime (e.g. a token to be used the next day); a
+ * {@code AllowPostdatingType} otherwise.
+ */
+ public AllowPostdatingType getAllowPostDating()
+ {
+ return allowPostDating;
+ }
+
+ /**
+ * <p>
+ * Specifies whether a request for a postdated token should be allowed or not.
+ * </p>
+ *
+ * @param allowPostDating {@code null} if the token can't have a future lifetime (e.g. a token to be used the next
+ * day); a {@code AllowPostdatingType} otherwise.
+ */
+ public void setAllowPostDating(AllowPostdatingType allowPostDating)
+ {
+ this.allowPostDating = allowPostDating;
+ this.delegate.getAny().add(this.factory.createAllowPostdating(allowPostDating));
+ }
+
+ /**
+ * <p>
+ * Obtains the renew semantics for this request.
+ * </p>
+ *
+ * @return a reference to the {@code RenewingType} that represents the renew semantics for this request.
+ */
+ public RenewingType getRenewing()
+ {
+ return renewing;
+ }
+
+ /**
+ * <p>
+ * Sets the renew semantics for this request.
+ * </p>
+ *
+ * @param renewing the {@code RenewingType} object representing the semantics to be set.
+ */
+ public void setRenewing(RenewingType renewing)
+ {
+ this.renewing = renewing;
+ this.delegate.getAny().add(this.factory.createRenewing(renewing));
+ }
+
+ /**
+ * <p>
+ * Obtains the identity on whose behalf this request was made.
+ * </p>
+ *
+ * @return a reference to the {@code OnBehalfOfType} that represents the identity on whose behalf this request was
+ * made.
+ */
+ public OnBehalfOfType getOnBehalfOf()
+ {
+ return onBehalfOf;
+ }
+
+ /**
+ * <p>
+ * Specifies the identity on whose behalf this request is being made.
+ * </p>
+ *
+ * @param onBehalfOf the {@code OnBehalfOfType} object representing the identity to be set.
+ */
+ public void setOnBehalfOf(OnBehalfOfType onBehalfOf)
+ {
+ this.onBehalfOf = onBehalfOf;
+ this.delegate.getAny().add(this.factory.createOnBehalfOf(onBehalfOf));
+ }
+
+ /**
+ * <p>
+ * Obtains the issuer of the token included in the request in the scenarios where the requestor is obtaining a token
+ * on behalf of another party.
+ * </p>
+ *
+ * @return a reference to the {@code EndpointReferenceType} that represents the issuer.
+ */
+ public EndpointReferenceType getIssuer()
+ {
+ return this.issuer;
+ }
+
+ /**
+ * <p>
+ * Sets the issuer of the token included in the request in scenarios where the requestor is obtaining a token on
+ * behalf of another party.
+ * </p>
+ *
+ * @param issuer the {@code EndpointReferenceType} object representing the issuer to be set.
+ */
+ public void setIssuer(EndpointReferenceType issuer)
+ {
+ this.issuer = issuer;
+ this.delegate.getAny().add(this.factory.createIssuer(issuer));
+ }
+
+ /**
+ * <p>
+ * Obtains the type of authentication that has been set as part of the request.
+ * </p>
+ *
+ * @return a {@code URI} that identifies the desired authentication type.
+ */
+ public URI getAuthenticationType()
+ {
+ return authenticationType;
+ }
+
+ /**
+ * <p>
+ * Sets the authentication type in the request.
+ * </p>
+ *
+ * @param authenticationType a {@code URI} that identifies the authentication type to be set.
+ */
+ public void setAuthenticationType(URI authenticationType)
+ {
+ this.authenticationType = authenticationType;
+ this.delegate.getAny().add(this.factory.createAuthenticationType(authenticationType.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the type of the key that has been set in the request.
+ * </p>
+ *
+ * @return a {@code URI} that identifies the key type.
+ */
+ public URI getKeyType()
+ {
+ return keyType;
+ }
+
+ /**
+ * <p>
+ * Sets the key type in the request.
+ * </p>
+ *
+ * @param keyType a {@code URI} that specifies the key type.
+ */
+ public void setKeyType(URI keyType)
+ {
+ this.keyType = keyType;
+ this.delegate.getAny().add(this.factory.createKeyType(keyType.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the size of they key that has been set in the request.
+ * </p>
+ *
+ * @return a {@code long} representing the key size in bytes.
+ */
+ public long getKeySize()
+ {
+ return keySize;
+ }
+
+ /**
+ * <p>
+ * Sets the size of the key in the request.
+ * </p>
+ *
+ * @param keySize a {@code long} representing the key size in bytes.
+ */
+ public void setKeySize(long keySize)
+ {
+ this.keySize = keySize;
+ this.delegate.getAny().add(this.factory.createKeySize(keySize));
+ }
+
+ /**
+ * <p>
+ * Obtains the signature algorithm that has been set in the request.
+ * </p>
+ *
+ * @return a {@code URI} that represents the signature algorithm.
+ */
+ public URI getSignatureAlgorithm()
+ {
+ return signatureAlgorithm;
+ }
+
+ /**
+ * <p>
+ * Sets the signature algorithm in the request.
+ * </p>
+ *
+ * @param signatureAlgorithm a {@code URI} that represents the algorithm to be set.
+ */
+ public void setSignatureAlgorithm(URI signatureAlgorithm)
+ {
+ this.signatureAlgorithm = signatureAlgorithm;
+ this.delegate.getAny().add(this.factory.createSignatureAlgorithm(signatureAlgorithm.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code Encryption} section of the request. The {@code Encryption} element indicates that the requestor
+ * desires any returned secrets in issued security tokens to be encrypted.
+ * </p>
+ *
+ * @return a reference to the {@code EncryptionType} object.
+ */
+ public EncryptionType getEncryption()
+ {
+ return encryption;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code Encryption} section of the request. The {@code Encryption} element indicates that the requestor
+ * desires any returned secrets in issued security tokens to be encrypted.
+ * </p>
+ *
+ * @param encryption the {@code EncryptionType} to be set.
+ */
+ public void setEncryption(EncryptionType encryption)
+ {
+ this.encryption = encryption;
+ this.delegate.getAny().add(this.factory.createEncryption(encryption));
+ }
+
+ /**
+ * <p>
+ * Obtains the encryption algorithm that has been set in the request.
+ * </p>
+ *
+ * @return a {@code URI} that represents the encryption algorithm.
+ */
+ public URI getEncryptionAlgorithm()
+ {
+ return encryptionAlgorithm;
+ }
+
+ /**
+ * <p>
+ * Sets the encryption algorithm in the request.
+ * </p>
+ *
+ * @param encryptionAlgorithm a {@code URI} that represents the encryption algorithm to be set.
+ */
+ public void setEncryptionAlgorithm(URI encryptionAlgorithm)
+ {
+ this.encryptionAlgorithm = encryptionAlgorithm;
+ this.delegate.getAny().add(this.factory.createEncryptionAlgorithm(encryptionAlgorithm.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the canonicalization algorithm that has been set in the request.
+ * </p>
+ *
+ * @return a {@code URI} that represents the canonicalization algorithm.
+ */
+ public URI getCanonicalizationAlgorithm()
+ {
+ return canonicalizationAlgorithm;
+ }
+
+ /**
+ * <p>
+ * Sets the canonicalization algorithm in the request.
+ * </p>
+ *
+ * @param canonicalizationAlgorithm a {@code URI} that represents the algorithm to be set.
+ */
+ public void setCanonicalizationAlgorithm(URI canonicalizationAlgorithm)
+ {
+ this.canonicalizationAlgorithm = canonicalizationAlgorithm;
+ this.delegate.getAny().add(this.factory.createCanonicalizationAlgorithm(canonicalizationAlgorithm.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code ProofEncryption} section of the request. The {@code ProofEncryption} indicates that the
+ * requestor desires any returned secrets in issued security tokens to be encrypted.
+ * </p>
+ *
+ * @return a reference to the {@code ProofEncryptionType} object.
+ */
+ public ProofEncryptionType getProofEncryption()
+ {
+ return proofEncryption;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code ProofEncryption} section of the request. The {@code ProofEncryption} indicates that the requestor
+ * desires any returned secrets in issued security tokens to be encrypted.
+ * </p>
+ *
+ * @param proofEncryption the {@code ProofEncryptionType} to be set.
+ */
+ public void setProofEncryption(ProofEncryptionType proofEncryption)
+ {
+ this.proofEncryption = proofEncryption;
+ this.delegate.getAny().add(this.factory.createProofEncryption(proofEncryption));
+ }
+
+ /**
+ * <p>
+ * Obtains the key that should be used in the returned token.
+ * </p>
+ *
+ * @return a reference to the {@code UseKeyType} instance that represents the key to be used.
+ */
+ public UseKeyType getUseKey()
+ {
+ return useKey;
+ }
+
+ /**
+ * <p>
+ * Sets the key that should be used in the returned token.
+ * </p>
+ *
+ * @param useKey the {@code UseKeyType} instance to be set.
+ */
+ public void setUseKey(UseKeyType useKey)
+ {
+ this.useKey = useKey;
+ this.delegate.getAny().add(this.factory.createUseKey(useKey));
+ }
+
+ /**
+ * <p>
+ * Obtains the signature algorithm that should be used with the issued security token.
+ * </p>
+ *
+ * @return a {@code URI} representing the algorithm that should be used.
+ */
+ public URI getSignWith()
+ {
+ return signWith;
+ }
+
+ /**
+ * <p>
+ * Sets the signature algorithm that should be used with the issued security token.
+ * </p>
+ *
+ * @param signWith a {@code URI} representing the algorithm to be used.
+ */
+ public void setSignWith(URI signWith)
+ {
+ this.signWith = signWith;
+ this.delegate.getAny().add(this.factory.createSignatureAlgorithm(signWith.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the encryption algorithm that should be used with the issued security token.
+ * </p>
+ *
+ * @return a {@code URI} representing the encryption algorithm that should be used.
+ */
+ public URI getEncryptWith()
+ {
+ return encryptWith;
+ }
+
+ /**
+ * <p>
+ * Sets the encryption algorithm that should be used with the issued security token.
+ * </p>
+ *
+ * @param encryptWith a {@code URI} representing the algorithm to be used.
+ */
+ public void setEncryptWith(URI encryptWith)
+ {
+ this.encryptWith = encryptWith;
+ this.delegate.getAny().add(this.factory.createEncryptWith(encryptWith.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the identity to which the requested token should be delegated.
+ * </p>
+ *
+ * @return a reference to the {@code DelegateToType} instance that represents the identity.
+ */
+ public DelegateToType getDelegateTo()
+ {
+ return delegateTo;
+ }
+
+ /**
+ * <p>
+ * Sets the identity to which the requested token should be delegated.
+ * </p>
+ *
+ * @param delegateTo the {@code DelegateToType} object representing the identity to be set.
+ */
+ public void setDelegateTo(DelegateToType delegateTo)
+ {
+ this.delegateTo = delegateTo;
+ this.delegate.getAny().add(this.factory.createDelegateTo(delegateTo));
+ }
+
+ /**
+ * <p>
+ * Indicates whether the requested token should be marked as "forwardable" or not. In general, this flag is used when
+ * a token is normally bound to the requestor's machine or service. Using this flag, the returned token MAY be used
+ * from any source machine so long as the key is correctly proven.
+ * </p>
+ *
+ * @return {@code true} if the requested token should be marked as "forwardable"; {@code false} otherwise.
+ */
+ public boolean isForwardable()
+ {
+ return forwardable;
+ }
+
+ /**
+ * <p>
+ * Specifies whether the requested token should be marked as "forwardable" or not. In general, this flag is used when
+ * a token is normally bound to the requestor's machine or service. Using this flag, the returned token MAY be used
+ * from any source machine so long as the key is correctly proven.
+ * </p>
+ *
+ * @param forwardable {@code true} if the requested token should be marked as "forwardable"; {@code false} otherwise.
+ */
+ public void setForwardable(boolean forwardable)
+ {
+ this.forwardable = forwardable;
+ this.delegate.getAny().add(this.factory.createForwardable(forwardable));
+ }
+
+ /**
+ * <p>
+ * Indicates whether the requested token should be marked as "delegatable" or not. Using this flag, the returned
+ * token MAY be delegated to another party.
+ * </p>
+ *
+ * @return {@code true} if the requested token should be marked as "delegatable"; {@code false} otherwise.
+ */
+ public boolean isDelegatable()
+ {
+ return delegatable;
+ }
+
+ /**
+ * <p>
+ * Specifies whether the requested token should be marked as "delegatable" or not. Using this flag, the returned
+ * token MAY be delegated to another party.
+ * </p>
+ *
+ * @param delegatable {@code true} if the requested token should be marked as "delegatable"; {@code false} otherwise.
+ */
+ public void setDelegatable(boolean delegatable)
+ {
+ this.delegatable = delegatable;
+ this.delegate.getAny().add(this.factory.createDelegatable(delegatable));
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code Policy} associated with the request. The policy specifies defaults that can be overridden by
+ * the previous properties.
+ * </p>
+ *
+ * @return a reference to the {@code Policy} that has been set in the request.
+ */
+ public Policy getPolicy()
+ {
+ return policy;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code Policy} in the request. The policy specifies defaults that can be overridden by
+ * the previous properties.
+ * </p>
+ *
+ * @param policy the {@code Policy} instance to be set.
+ */
+ public void setPolicy(Policy policy)
+ {
+ this.policy = policy;
+ this.delegate.getAny().add(policy);
+ }
+
+ /**
+ * <p>
+ * Obtains the reference to the {@code Policy} that should be used.
+ * </p>
+ *
+ * @return a {@code PolicyReference} that specifies where the {@code Policy} can be found.
+ */
+ public PolicyReference getPolicyReference()
+ {
+ return policyReference;
+ }
+
+ /**
+ * <p>
+ * Sets the reference to the {@code Policy} that should be used.
+ * </p>
+ *
+ * @param policyReference the {@code PolicyReference} object to be set.
+ */
+ public void setPolicyReference(PolicyReference policyReference)
+ {
+ this.policyReference = policyReference;
+ this.delegate.getAny().add(policyReference);
+ }
+
+ /**
+ * <p>
+ * Obtains the list of request elements that are not part of the standard content model.
+ * </p>
+ *
+ * @return a {@code List<Object>} containing the extension elements.
+ */
+ public List<Object> getExtensionElements()
+ {
+ return Collections.unmodifiableList(this.extensionElements);
+ }
+
+ /**
+ * <p>
+ * Obtains the request context.
+ * </p>
+ *
+ * @return a {@code String} that identifies the request.
+ */
+ public String getContext()
+ {
+ return this.delegate.getContext();
+ }
+
+ /**
+ * <p>
+ * Sets the request context.
+ * </p>
+ *
+ * @param context a {@code String} that identifies the request.
+ */
+ public void setContext(String context)
+ {
+ this.delegate.setContext(context);
+ }
+
+ /**
+ * <p>
+ * Obtains a map that contains attributes that aren't bound to any typed property on the request. This is a live
+ * reference, so attributes can be added/changed/removed directly. For this reason, there is no setter method.
+ * </p>
+ *
+ * @return a {@code Map<QName, String>} that contains the attributes.
+ */
+ public Map<QName, String> getOtherAttributes()
+ {
+ return this.delegate.getOtherAttributes();
+ }
+
+ /**
+ * <p>
+ * Gets a reference to the list that holds all request element values.
+ * </p>
+ *
+ * @return a {@code List<Object>} containing all values specified in the request.
+ */
+ public List<Object> getAny()
+ {
+ return this.delegate.getAny();
+ }
+
+ /**
+ * <p>
+ * Obtains a reference to the {@code RequestSecurityTokenType} delegate.
+ * </p>
+ *
+ * @return a reference to the delegate instance.
+ */
+ public RequestSecurityTokenType getDelegate()
+ {
+ return this.delegate;
+ }
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenCollection.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenCollection.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenCollection.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust.protocol;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenCollectionType;
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenType;
+
+/**
+ * <p>
+ * This class represents a WS-Trust {@code RequestSecurityTokenCollection}. It wraps the JAXB representation of the
+ * security token collection request.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class RequestSecurityTokenCollection implements BaseRequestSecurityToken
+{
+
+ private final RequestSecurityTokenCollectionType delegate;
+
+ private final List<RequestSecurityToken> requestSecurityTokens;
+
+ /**
+ * <p>
+ * Creates an instance of {@code RequestSecurityTokenCollection}.
+ * </p>
+ */
+ public RequestSecurityTokenCollection()
+ {
+ this.requestSecurityTokens = new ArrayList<RequestSecurityToken>();
+ this.delegate = new RequestSecurityTokenCollectionType();
+ }
+
+ /**
+ * <p>
+ * Creates an instance of {@code RequestSecurityTokenCollection} using the specified delegate.
+ * </p>
+ *
+ * @param delegate the JAXB {@code RequestSecurityTokenCollectionType} that represents a WS-Trust request collection.
+ */
+ public RequestSecurityTokenCollection(RequestSecurityTokenCollectionType delegate)
+ {
+ this.delegate = delegate;
+ this.requestSecurityTokens = new ArrayList<RequestSecurityToken>();
+ for (RequestSecurityTokenType request : delegate.getRequestSecurityToken())
+ this.requestSecurityTokens.add(new RequestSecurityToken(request));
+ }
+
+ /**
+ * <p>
+ * Obtains the collection of {@code RequestSecurityToken} objects. The returned collection is immutable, so addition
+ * or removal of requests must be carried by the appropriate add/remove methods.
+ * </p>
+ *
+ * @return a {@code List<RequestSecurityToken>} containing the token requests.
+ */
+ public List<RequestSecurityToken> getRequestSecurityTokens()
+ {
+ return Collections.unmodifiableList(this.requestSecurityTokens);
+ }
+
+ /**
+ * <p>
+ * Adds the specified {@code RequestSecurityToken} object to the collection of token requests.
+ * </p>
+ *
+ * @param request the {@code RequestSecurityToken} to be added.
+ */
+ public void addRequestSecurityToken(RequestSecurityToken request)
+ {
+ this.delegate.getRequestSecurityToken().add(request.getDelegate());
+ this.requestSecurityTokens.add(request);
+ }
+
+ /**
+ * <p>
+ * Removes the specified {@code RequestSecurityToken} object from the collection of token requests.
+ * </p>
+ *
+ * @param request the {@code RequestSecurityToken} to be removed.
+ */
+ public void removeRequestSecurityToken(RequestSecurityToken request)
+ {
+ this.delegate.getRequestSecurityToken().remove(request.getDelegate());
+ this.requestSecurityTokens.remove(request);
+ }
+
+ /**
+ * <p>
+ * Obtains a reference to the {@code RequestSecurityTokenCollectionType} delegate.
+ * </p>
+ *
+ * @return a reference to the delegate instance.
+ */
+ public RequestSecurityTokenCollectionType getDelegate()
+ {
+ return this.delegate;
+ }
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenResponse.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenResponse.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenResponse.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,1159 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust.protocol;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+
+import org.jboss.identity.federation.ws.addressing.EndpointReferenceType;
+import org.jboss.identity.federation.ws.policy.AppliesTo;
+import org.jboss.identity.federation.ws.policy.Policy;
+import org.jboss.identity.federation.ws.policy.PolicyReference;
+import org.jboss.identity.federation.ws.trust.AllowPostdatingType;
+import org.jboss.identity.federation.ws.trust.AuthenticatorType;
+import org.jboss.identity.federation.ws.trust.DelegateToType;
+import org.jboss.identity.federation.ws.trust.EncryptionType;
+import org.jboss.identity.federation.ws.trust.EntropyType;
+import org.jboss.identity.federation.ws.trust.LifetimeType;
+import org.jboss.identity.federation.ws.trust.ObjectFactory;
+import org.jboss.identity.federation.ws.trust.OnBehalfOfType;
+import org.jboss.identity.federation.ws.trust.ProofEncryptionType;
+import org.jboss.identity.federation.ws.trust.RenewingType;
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponseType;
+import org.jboss.identity.federation.ws.trust.RequestedProofTokenType;
+import org.jboss.identity.federation.ws.trust.RequestedReferenceType;
+import org.jboss.identity.federation.ws.trust.RequestedSecurityTokenType;
+import org.jboss.identity.federation.ws.trust.StatusType;
+import org.jboss.identity.federation.ws.trust.UseKeyType;
+
+/**
+ * <p>
+ * This class represents a WS-Trust {@code RequestSecurityTokenResponse}. It wraps the JAXB representation of the
+ * security token response and offers a series of getter/setter methods that make it easy to work with elements that are
+ * represented by the {@code Any} XML type.
+ * </p>
+ * <p>
+ * The following shows the intended content model of a {@code RequestSecurityTokenResponse}:
+ *
+ * <pre>
+ * <xs:element ref='wst:TokenType' minOccurs='0' />
+ * <xs:element ref='wst:RequestType' />
+ * <xs:element ref='wst:RequestedSecurityToken' minOccurs='0' />
+ * <xs:element ref='wsp:AppliesTo' minOccurs='0' />
+ * <xs:element ref='wst:RequestedAttachedReference' minOccurs='0' />
+ * <xs:element ref='wst:RequestedUnattachedReference' minOccurs='0' />
+ * <xs:element ref='wst:RequestedProofToken' minOccurs='0' />
+ * <xs:element ref='wst:Entropy' minOccurs='0' />
+ * <xs:element ref='wst:Lifetime' minOccurs='0' />
+ * <xs:element ref='wst:Status' minOccurs='0' />
+ * <xs:element ref='wst:AllowPostdating' minOccurs='0' />
+ * <xs:element ref='wst:Renewing' minOccurs='0' />
+ * <xs:element ref='wst:OnBehalfOf' minOccurs='0' />
+ * <xs:element ref='wst:Issuer' minOccurs='0' />
+ * <xs:element ref='wst:AuthenticationType' minOccurs='0' />
+ * <xs:element ref='wst:Authenticator' minOccurs='0' />
+ * <xs:element ref='wst:KeyType' minOccurs='0' />
+ * <xs:element ref='wst:KeySize' minOccurs='0' />
+ * <xs:element ref='wst:SignatureAlgorithm' minOccurs='0' />
+ * <xs:element ref='wst:Encryption' minOccurs='0' />
+ * <xs:element ref='wst:EncryptionAlgorithm' minOccurs='0' />
+ * <xs:element ref='wst:CanonicalizationAlgorithm' minOccurs='0' />
+ * <xs:element ref='wst:ProofEncryption' minOccurs='0' />
+ * <xs:element ref='wst:UseKey' minOccurs='0' />
+ * <xs:element ref='wst:SignWith' minOccurs='0' />
+ * <xs:element ref='wst:EncryptWith' minOccurs='0' />
+ * <xs:element ref='wst:DelegateTo' minOccurs='0' />
+ * <xs:element ref='wst:Forwardable' minOccurs='0' />
+ * <xs:element ref='wst:Delegatable' minOccurs='0' />
+ * <xs:element ref='wsp:Policy' minOccurs='0' />
+ * <xs:element ref='wsp:PolicyReference' minOccurs='0' />
+ * <xs:any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded' />
+ * </pre>
+ *
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+/**
+ * <p>
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class RequestSecurityTokenResponse implements BaseRequestSecurityTokenResponse
+{
+
+ private final RequestSecurityTokenResponseType delegate;
+
+ private URI tokenType;
+
+ private URI requestType;
+
+ private RequestedSecurityTokenType requestedSecurityToken;
+
+ private AppliesTo appliesTo;
+
+ private RequestedReferenceType requestedAttachedReference;
+
+ private RequestedReferenceType requestedUnattachedReference;
+
+ private RequestedProofTokenType requestedProofToken;
+
+ private EntropyType entropy;
+
+ private LifetimeType lifetime;
+
+ private StatusType status;
+
+ private AllowPostdatingType allowPostDating;
+
+ private RenewingType renewing;
+
+ private OnBehalfOfType onBehalfOf;
+
+ private EndpointReferenceType issuer;
+
+ private URI authenticationType;
+
+ private AuthenticatorType authenticator;
+
+ private URI keyType;
+
+ private long keySize;
+
+ private URI signatureAlgorithm;
+
+ private EncryptionType encryption;
+
+ private URI encryptionAlgorithm;
+
+ private URI canonicalizationAlgorithm;
+
+ private ProofEncryptionType proofEncryption;
+
+ private UseKeyType useKey;
+
+ private URI signWith;
+
+ private URI encryptWith;
+
+ private DelegateToType delegateTo;
+
+ private boolean forwardable;
+
+ private boolean delegatable;
+
+ private Policy policy;
+
+ private PolicyReference policyReference;
+
+ private final List<Object> extensionElements = new ArrayList<Object>();
+
+ private final ObjectFactory factory = new ObjectFactory();
+
+ /**
+ * <p>
+ * Creates an instance of {@code RequestSecurityTokenResponse}.
+ * </p>
+ */
+ public RequestSecurityTokenResponse()
+ {
+ this.delegate = new RequestSecurityTokenResponseType();
+ }
+
+ /**
+ * <p>
+ * Creates an instance of {@code RequestSecurityTokenResponse} using the specified delegate.
+ * </p>
+ *
+ * @param delegate the JAXB {@code RequestSecurityTokenResponseType} that represents a WS-Trust response.
+ */
+ public RequestSecurityTokenResponse(RequestSecurityTokenResponseType delegate)
+ {
+ this.delegate = delegate;
+ // parse the delegate's Any contents.
+ try
+ {
+ for (Object obj : this.delegate.getAny())
+ {
+ if (obj instanceof AppliesTo)
+ {
+ this.appliesTo = (AppliesTo) obj;
+ }
+ else if (obj instanceof Policy)
+ {
+ this.policy = (Policy) obj;
+ }
+ else if (obj instanceof PolicyReference)
+ {
+ this.policyReference = (PolicyReference) obj;
+ }
+ else if (obj instanceof JAXBElement)
+ {
+ JAXBElement<?> element = (JAXBElement<?>) obj;
+ String localName = element.getName().getLocalPart();
+ if (localName.equalsIgnoreCase("TokenType"))
+ this.tokenType = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("RequestType"))
+ this.requestType = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("RequestedSecurityToken"))
+ this.requestedSecurityToken = (RequestedSecurityTokenType) element.getValue();
+ else if (localName.equalsIgnoreCase("RequestedAttachedReference"))
+ this.requestedAttachedReference = (RequestedReferenceType) element.getValue();
+ else if (localName.equalsIgnoreCase("RequestedUnattachedReference"))
+ this.requestedUnattachedReference = (RequestedReferenceType) element.getValue();
+ else if (localName.equalsIgnoreCase("RequestedProofToken"))
+ this.requestedProofToken = (RequestedProofTokenType) element.getValue();
+ else if (localName.equalsIgnoreCase("Entropy"))
+ this.entropy = (EntropyType) element.getValue();
+ else if (localName.equalsIgnoreCase("Lifetime"))
+ this.lifetime = (LifetimeType) element.getValue();
+ else if (localName.equalsIgnoreCase("Status"))
+ this.status = (StatusType) element.getValue();
+ else if (localName.equalsIgnoreCase("AllowPostdating"))
+ this.allowPostDating = (AllowPostdatingType) element.getValue();
+ else if (localName.equalsIgnoreCase("Renewing"))
+ this.renewing = (RenewingType) element.getValue();
+ else if (localName.equalsIgnoreCase("OnBehalfOf"))
+ this.onBehalfOf = (OnBehalfOfType) element.getValue();
+ else if (localName.equalsIgnoreCase("Issuer"))
+ this.issuer = (EndpointReferenceType) element.getValue();
+ else if (localName.equalsIgnoreCase("AuthenticationType"))
+ this.authenticationType = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("Authenticator"))
+ this.authenticator = (AuthenticatorType) element.getValue();
+ else if (localName.equalsIgnoreCase("KeyType"))
+ this.keyType = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("KeySize"))
+ this.keySize = (Long) element.getValue();
+ else if (localName.equalsIgnoreCase("SignatureAlgorithm"))
+ this.signatureAlgorithm = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("Encryption"))
+ this.encryption = (EncryptionType) element.getValue();
+ else if (localName.equalsIgnoreCase("EntropyAlgorithm"))
+ this.encryptionAlgorithm = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("CanonicalizationAlgorithm"))
+ this.canonicalizationAlgorithm = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("ProofEncryption"))
+ this.proofEncryption = (ProofEncryptionType) element.getValue();
+ else if (localName.equalsIgnoreCase("UseKey"))
+ this.useKey = (UseKeyType) element.getValue();
+ else if (localName.equalsIgnoreCase("SignWith"))
+ this.signWith = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("EncryptWith"))
+ this.encryptWith = new URI((String) element.getValue());
+ else if (localName.equalsIgnoreCase("DelegateTo"))
+ this.delegateTo = (DelegateToType) element.getValue();
+ else if (localName.equalsIgnoreCase("Forwardable"))
+ this.forwardable = (Boolean) element.getValue();
+ else if (localName.equalsIgnoreCase("Delegatable"))
+ this.delegatable = (Boolean) element.getValue();
+ else
+ this.extensionElements.add(element.getValue());
+ }
+ else
+ {
+ this.extensionElements.add(obj);
+ }
+ }
+ }
+ catch (URISyntaxException e)
+ {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code URI} that identifies the token type.
+ * </p>
+ *
+ * @return a {@code URI} that represents the token type.
+ */
+ public URI getTokenType()
+ {
+ return tokenType;
+ }
+
+ /**
+ * <p>
+ * Sets the token type.
+ * </p>
+ *
+ * @param tokenType a {@code URI} that identifies the token type.
+ */
+ public void setTokenType(URI tokenType)
+ {
+ this.tokenType = tokenType;
+ this.delegate.getAny().add(this.factory.createTokenType(tokenType.toString()));
+
+ }
+
+ /**
+ * <p>
+ * Obtains the request type.
+ * </p>
+ *
+ * @return a {@code URI} that identifies the request type.
+ */
+ public URI getRequestType()
+ {
+ return requestType;
+ }
+
+ /**
+ * <p>
+ * Sets the request type. The type must be one of the request types described in the WS-Trust specification.
+ * </p>
+ *
+ * @param requestType a {@code URI} that identifies the request type.
+ */
+ public void setRequestType(URI requestType)
+ {
+ this.requestType = requestType;
+ this.delegate.getAny().add(this.factory.createRequestType(requestType.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the requested security token that has been set in the response.
+ * </p>
+ *
+ * @return a reference to the {@code RequestedSecurityTokenType} that contains the token.
+ */
+ public RequestedSecurityTokenType getRequestedSecurityToken()
+ {
+ return requestedSecurityToken;
+ }
+
+ /**
+ * <p>
+ * Sets the requested security token in the response.
+ * </p>
+ *
+ * @param requestedSecurityToken the {@code RequestedSecurityTokenType} instance to be set.
+ */
+ public void setRequestedSecurityToken(RequestedSecurityTokenType requestedSecurityToken)
+ {
+ this.requestedSecurityToken = requestedSecurityToken;
+ this.delegate.getAny().add(this.factory.createRequestedSecurityToken(requestedSecurityToken));
+ }
+
+ /**
+ * <p>
+ * Obtains the scope to which the security token applies.
+ * </p>
+ *
+ * @return a reference to the {@code AppliesTo} instance that represents the token scope.
+ */
+ public AppliesTo getAppliesTo()
+ {
+ return appliesTo;
+ }
+
+ /**
+ * <p>
+ * Sets the scope to which the security token applies.
+ * </p>
+ *
+ * @param appliesTo a reference to the {@code AppliesTo} object that represents the scope to be set.
+ */
+ public void setAppliesTo(AppliesTo appliesTo)
+ {
+ this.appliesTo = appliesTo;
+ this.delegate.getAny().add(appliesTo);
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code RequestedAttachedReference} that indicate how to reference the returned token when that token
+ * doesn't support references using URI fragments (XML ID).
+ * </p>
+ *
+ * @return a {@code RequestedReferenceType} that represents the token reference.
+ */
+ public RequestedReferenceType getRequestedAttachedReference()
+ {
+ return requestedAttachedReference;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code RequestedAttachedReference} that indicate how to reference the returned token when that token
+ * doesn't support references using URI fragments (XML ID).
+ * </p>
+ *
+ * @param requestedAttachedReference the {@code RequestedReferenceType} instance to be set.
+ */
+ public void setRequestedAttachedReference(RequestedReferenceType requestedAttachedReference)
+ {
+ this.requestedAttachedReference = requestedAttachedReference;
+ this.delegate.getAny().add(this.factory.createRequestedAttachedReference(requestedAttachedReference));
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code RequestedUnattachedReference} that specifies to indicate how to reference the token when it is
+ * not placed inside the message.
+ * </p>
+ *
+ * @return a {@code RequestedReferenceType} that represents the unattached reference.
+ */
+ public RequestedReferenceType getRequestedUnattachedReference()
+ {
+ return requestedUnattachedReference;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code RequestedUnattachedReference} that specifies to indicate how to reference the token when it is not
+ * placed inside the message.
+ * </p>
+ *
+ * @param requestedUnattachedReference the {@code RequestedReferenceType} instance to be set.
+ */
+ public void setRequestedUnattachedReference(RequestedReferenceType requestedUnattachedReference)
+ {
+ this.requestedUnattachedReference = requestedUnattachedReference;
+ this.delegate.getAny().add(this.factory.createRequestedUnattachedReference(requestedUnattachedReference));
+ }
+
+ /**
+ * <p>
+ * Obtains the proof of possession token that has been set in the response.
+ * </p>
+ *
+ * @return a reference to the {@code RequestedProofTokenType} that contains the token.
+ */
+ public RequestedProofTokenType getRequestedProofToken()
+ {
+ return requestedProofToken;
+ }
+
+ /**
+ * <p>
+ * Sets the proof of possesion token in the response.
+ * </p>
+ *
+ * @param requestedProofToken the {@code RequestedProofTokenType} instance to be set.
+ */
+ public void setRequestedProofToken(RequestedProofTokenType requestedProofToken)
+ {
+ this.requestedProofToken = requestedProofToken;
+ this.delegate.getAny().add(this.factory.createRequestedProofToken(requestedProofToken));
+ }
+
+ /**
+ * <p>
+ * Obtains the entropy that has been used in creating the key.
+ * </p>
+ *
+ * @return a reference to the {@code EntropyType} that represents the entropy.
+ */
+ public EntropyType getEntropy()
+ {
+ return entropy;
+ }
+
+ /**
+ * <p>
+ * Sets the entropy that has been used in creating the key.
+ * </p>
+ *
+ * @param entropy the {@code EntropyType} representing the entropy to be set.
+ */
+ public void setEntropy(EntropyType entropy)
+ {
+ this.entropy = entropy;
+ this.delegate.getAny().add(this.factory.createEntropy(entropy));
+ }
+
+ /**
+ * <p>
+ * Obtains the lifetime of the security token.
+ * </p>
+ *
+ * @return a reference to the {@code LifetimeType} that represents the lifetime of the security token.
+ */
+ public LifetimeType getLifetime()
+ {
+ return lifetime;
+ }
+
+ /**
+ * <p>
+ * Sets the lifetime of the security token.
+ * </p>
+ *
+ * @param lifetime the {@code LifetimeType} object representing the lifetime to be set.
+ */
+ public void setLifetime(LifetimeType lifetime)
+ {
+ this.lifetime = lifetime;
+ this.delegate.getAny().add(this.factory.createLifetime(lifetime));
+ }
+
+ /**
+ * <p>
+ * Obtains the result of a security token validation.
+ * </p>
+ *
+ * @return a referece to the {@code StatusType} instance that represents the status of the validation.
+ */
+ public StatusType getStatus()
+ {
+ return status;
+ }
+
+ /**
+ * <p>
+ * Sets the result of a security token validation.
+ * </p>
+ *
+ * @param status the {@code StatusType} instance to be set.
+ */
+ public void setStatus(StatusType status)
+ {
+ this.status = status;
+ this.delegate.getAny().add(this.factory.createStatus(status));
+ }
+
+ /**
+ * <p>
+ * Checks whether the returned token is a postdated token or not.
+ * </p>
+ *
+ * @return {@code null} if the token is not postdated; a {@code AllowPostdatingType} otherwise.
+ */
+ public AllowPostdatingType getAllowPostDating()
+ {
+ return allowPostDating;
+ }
+
+ /**
+ * <p>
+ * Specifies whether the returned token is a postdated token or not.
+ * </p>
+ *
+ * @param allowPostDating {@code null} if the token is not postdated; a {@code AllowPostdatingType} otherwise.
+ */
+ public void setAllowPostDating(AllowPostdatingType allowPostDating)
+ {
+ this.allowPostDating = allowPostDating;
+ this.delegate.getAny().add(this.factory.createAllowPostdating(allowPostDating));
+ }
+
+ /**
+ * <p>
+ * Obtains the renew semantics for the token request.
+ * </p>
+ *
+ * @return a reference to the {@code RenewingType} that represents the renew semantics for the request.
+ */
+ public RenewingType getRenewing()
+ {
+ return renewing;
+ }
+
+ /**
+ * <p>
+ * Sets the renew semantics for the token request.
+ * </p>
+ *
+ * @param renewing the {@code RenewingType} object representing the semantics to be set.
+ */
+ public void setRenewing(RenewingType renewing)
+ {
+ this.renewing = renewing;
+ this.delegate.getAny().add(this.factory.createRenewing(renewing));
+ }
+
+ /**
+ * <p>
+ * Obtains the identity on whose behalf the token request was made.
+ * </p>
+ *
+ * @return a reference to the {@code OnBehalfOfType} that represents the identity on whose behalf the token request
+ * was made.
+ */
+ public OnBehalfOfType getOnBehalfOf()
+ {
+ return onBehalfOf;
+ }
+
+ /**
+ * <p>
+ * Specifies the identity on whose behalf the token request was made.
+ * </p>
+ *
+ * @param onBehalfOf the {@code OnBehalfOfType} object representing the identity to be set.
+ */
+ public void setOnBehalfOf(OnBehalfOfType onBehalfOf)
+ {
+ this.onBehalfOf = onBehalfOf;
+ this.delegate.getAny().add(this.factory.createOnBehalfOf(onBehalfOf));
+ }
+
+ /**
+ * <p>
+ * Obtains the issuer of the token included in the request in the scenarios where the requestor is obtaining a token
+ * on behalf of another party.
+ * </p>
+ *
+ * @return a reference to the {@code EndpointReferenceType} that represents the issuer.
+ */
+ public EndpointReferenceType getIssuer()
+ {
+ return this.issuer;
+ }
+
+ /**
+ * <p>
+ * Sets the issuer of the token included in the request in scenarios where the requestor is obtaining a token on
+ * behalf of another party.
+ * </p>
+ *
+ * @param issuer the {@code EndpointReferenceType} object representing the issuer to be set.
+ */
+ public void setIssuer(EndpointReferenceType issuer)
+ {
+ this.issuer = issuer;
+ this.delegate.getAny().add(this.factory.createIssuer(issuer));
+ }
+
+ /**
+ * <p>
+ * Obtains the type of authentication that is to be conducted.
+ * </p>
+ *
+ * @return a {@code URI} that identifies the authentication type.
+ */
+ public URI getAuthenticationType()
+ {
+ return authenticationType;
+ }
+
+ /**
+ * <p>
+ * Sets the authentication type in the response.
+ * </p>
+ *
+ * @param authenticationType a {@code URI} that identifies the authentication type to be set.
+ */
+ public void setAuthenticationType(URI authenticationType)
+ {
+ this.authenticationType = authenticationType;
+ this.delegate.getAny().add(this.factory.createAuthenticationType(authenticationType.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the authenticator that must be used in authenticating exchanges.
+ * </p>
+ *
+ * @return a reference to the {@code AuthenticatorType} that represents the authenticator.
+ */
+ public AuthenticatorType getAuthenticator()
+ {
+ return authenticator;
+ }
+
+ /**
+ * <p>
+ * Sets the authenticator that must be used in authenticating exchanges.
+ * </p>
+ *
+ * @param authenticator the {@code AuthenticatorType} instance to be set.
+ */
+ public void setAuthenticator(AuthenticatorType authenticator)
+ {
+ this.authenticator = authenticator;
+ this.delegate.getAny().add(this.factory.createAuthenticator(authenticator));
+ }
+
+ /**
+ * <p>
+ * Obtains the type of the key that has been set in the response.
+ * </p>
+ *
+ * @return a {@code URI} that identifies the key type.
+ */
+ public URI getKeyType()
+ {
+ return keyType;
+ }
+
+ /**
+ * <p>
+ * Sets the key type in the response.
+ * </p>
+ *
+ * @param keyType a {@code URI} that specifies the key type.
+ */
+ public void setKeyType(URI keyType)
+ {
+ this.keyType = keyType;
+ this.delegate.getAny().add(this.factory.createKeyType(keyType.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the size of they key that has been set in the response.
+ * </p>
+ *
+ * @return a {@code long} representing the key size in bytes.
+ */
+ public long getKeySize()
+ {
+ return keySize;
+ }
+
+ /**
+ * <p>
+ * Sets the size of the key in the response.
+ * </p>
+ *
+ * @param keySize a {@code long} representing the key size in bytes.
+ */
+ public void setKeySize(long keySize)
+ {
+ this.keySize = keySize;
+ this.delegate.getAny().add(this.factory.createKeySize(keySize));
+ }
+
+ /**
+ * <p>
+ * Obtains the signature algorithm that has been set in the response.
+ * </p>
+ *
+ * @return a {@code URI} that represents the signature algorithm.
+ */
+ public URI getSignatureAlgorithm()
+ {
+ return signatureAlgorithm;
+ }
+
+ /**
+ * <p>
+ * Sets the signature algorithm in the response.
+ * </p>
+ *
+ * @param signatureAlgorithm a {@code URI} that represents the algorithm to be set.
+ */
+ public void setSignatureAlgorithm(URI signatureAlgorithm)
+ {
+ this.signatureAlgorithm = signatureAlgorithm;
+ this.delegate.getAny().add(this.factory.createSignatureAlgorithm(signatureAlgorithm.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code Encryption} section of the response. The {@code Encryption} element indicates that the
+ * requestor desires any returned secrets in issued security tokens to be encrypted.
+ * </p>
+ *
+ * @return a reference to the {@code EncryptionType} object.
+ */
+ public EncryptionType getEncryption()
+ {
+ return encryption;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code Encryption} section of the response. The {@code Encryption} element indicates that the requestor
+ * desires any returned secrets in issued security tokens to be encrypted.
+ * </p>
+ *
+ * @param encryption the {@code EncryptionType} to be set.
+ */
+ public void setEncryption(EncryptionType encryption)
+ {
+ this.encryption = encryption;
+ this.delegate.getAny().add(this.factory.createEncryption(encryption));
+ }
+
+ /**
+ * <p>
+ * Obtains the encryption algorithm that has been set in the response.
+ * </p>
+ *
+ * @return a {@code URI} that represents the encryption algorithm.
+ */
+ public URI getEncryptionAlgorithm()
+ {
+ return encryptionAlgorithm;
+ }
+
+ /**
+ * <p>
+ * Sets the encryption algorithm in the response.
+ * </p>
+ *
+ * @param encryptionAlgorithm a {@code URI} that represents the encryption algorithm to be set.
+ */
+ public void setEncryptionAlgorithm(URI encryptionAlgorithm)
+ {
+ this.encryptionAlgorithm = encryptionAlgorithm;
+ this.delegate.getAny().add(this.factory.createEncryptionAlgorithm(encryptionAlgorithm.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the canonicalization algorithm that has been set in the response.
+ * </p>
+ *
+ * @return a {@code URI} that represents the canonicalization algorithm.
+ */
+ public URI getCanonicalizationAlgorithm()
+ {
+ return canonicalizationAlgorithm;
+ }
+
+ /**
+ * <p>
+ * Sets the canonicalization algorithm in the response.
+ * </p>
+ *
+ * @param canonicalizationAlgorithm a {@code URI} that represents the algorithm to be set.
+ */
+ public void setCanonicalizationAlgorithm(URI canonicalizationAlgorithm)
+ {
+ this.canonicalizationAlgorithm = canonicalizationAlgorithm;
+ this.delegate.getAny().add(this.factory.createCanonicalizationAlgorithm(canonicalizationAlgorithm.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code ProofEncryption} section of the response. The {@code ProofEncryption} indicates that the
+ * requestor desires any returned secrets in issued security tokens to be encrypted.
+ * </p>
+ *
+ * @return a reference to the {@code ProofEncryptionType} object.
+ */
+ public ProofEncryptionType getProofEncryption()
+ {
+ return proofEncryption;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code ProofEncryption} section of the response. The {@code ProofEncryption} indicates that the requestor
+ * desires any returned secrets in issued security tokens to be encrypted.
+ * </p>
+ *
+ * @param proofEncryption the {@code ProofEncryptionType} to be set.
+ */
+ public void setProofEncryption(ProofEncryptionType proofEncryption)
+ {
+ this.proofEncryption = proofEncryption;
+ this.delegate.getAny().add(this.factory.createProofEncryption(proofEncryption));
+ }
+
+ /**
+ * <p>
+ * Obtains the key that used in the returned token.
+ * </p>
+ *
+ * @return a reference to the {@code UseKeyType} instance that represents the key used.
+ */
+ public UseKeyType getUseKey()
+ {
+ return useKey;
+ }
+
+ /**
+ * <p>
+ * Sets the key that used in the returned token.
+ * </p>
+ *
+ * @param useKey the {@code UseKeyType} instance to be set.
+ */
+ public void setUseKey(UseKeyType useKey)
+ {
+ this.useKey = useKey;
+ this.delegate.getAny().add(this.factory.createUseKey(useKey));
+ }
+
+ /**
+ * <p>
+ * Obtains the signature algorithm used with the issued security token.
+ * </p>
+ *
+ * @return a {@code URI} representing the algorithm used.
+ */
+ public URI getSignWith()
+ {
+ return signWith;
+ }
+
+ /**
+ * <p>
+ * Sets the signature algorithm used with the issued security token.
+ * </p>
+ *
+ * @param signWith a {@code URI} representing the algorithm used.
+ */
+ public void setSignWith(URI signWith)
+ {
+ this.signWith = signWith;
+ this.delegate.getAny().add(this.factory.createSignatureAlgorithm(signWith.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the encryption algorithm used with the issued security token.
+ * </p>
+ *
+ * @return a {@code URI} representing the encryption algorithm used.
+ */
+ public URI getEncryptWith()
+ {
+ return encryptWith;
+ }
+
+ /**
+ * <p>
+ * Sets the encryption algorithm used with the issued security token.
+ * </p>
+ *
+ * @param encryptWith a {@code URI} representing the algorithm used.
+ */
+ public void setEncryptWith(URI encryptWith)
+ {
+ this.encryptWith = encryptWith;
+ this.delegate.getAny().add(this.factory.createEncryptWith(encryptWith.toString()));
+ }
+
+ /**
+ * <p>
+ * Obtains the identity to which the requested token should be delegated.
+ * </p>
+ *
+ * @return a reference to the {@code DelegateToType} instance that represents the identity.
+ */
+ public DelegateToType getDelegateTo()
+ {
+ return delegateTo;
+ }
+
+ /**
+ * <p>
+ * Sets the identity to which the requested token should be delegated.
+ * </p>
+ *
+ * @param delegateTo the {@code DelegateToType} object representing the identity to be set.
+ */
+ public void setDelegateTo(DelegateToType delegateTo)
+ {
+ this.delegateTo = delegateTo;
+ this.delegate.getAny().add(this.factory.createDelegateTo(delegateTo));
+ }
+
+ /**
+ * <p>
+ * Indicates whether the requested token has been marked as "forwardable" or not. In general, this flag is used when
+ * a token is normally bound to the requestor's machine or service. Using this flag, the returned token MAY be used
+ * from any source machine so long as the key is correctly proven.
+ * </p>
+ *
+ * @return {@code true} if the requested token has been marked as "forwardable"; {@code false} otherwise.
+ */
+ public boolean isForwardable()
+ {
+ return forwardable;
+ }
+
+ /**
+ * <p>
+ * Specifies whether the requested token has been marked as "forwardable" or not. In general, this flag is used when
+ * a token is normally bound to the requestor's machine or service. Using this flag, the returned token MAY be used
+ * from any source machine so long as the key is correctly proven.
+ * </p>
+ *
+ * @param forwardable {@code true} if the requested token has been marked as "forwardable"; {@code false} otherwise.
+ */
+ public void setForwardable(boolean forwardable)
+ {
+ this.forwardable = forwardable;
+ this.delegate.getAny().add(this.factory.createForwardable(forwardable));
+ }
+
+ /**
+ * <p>
+ * Indicates whether the requested token has been marked as "delegatable" or not. Using this flag, the returned token
+ * MAY be delegated to another party.
+ * </p>
+ *
+ * @return {@code true} if the requested token has been marked as "delegatable"; {@code false} otherwise.
+ */
+ public boolean isDelegatable()
+ {
+ return delegatable;
+ }
+
+ /**
+ * <p>
+ * Specifies whether the requested token has been marked as "delegatable" or not. Using this flag, the returned token
+ * MAY be delegated to another party.
+ * </p>
+ *
+ * @param delegatable {@code true} if the requested token has been marked as "delegatable"; {@code false} otherwise.
+ */
+ public void setDelegatable(boolean delegatable)
+ {
+ this.delegatable = delegatable;
+ this.delegate.getAny().add(this.factory.createDelegatable(delegatable));
+ }
+
+ /**
+ * <p>
+ * Obtains the {@code Policy} that was associated with the request. The policy specifies defaults that can be
+ * overridden by the previous properties.
+ * </p>
+ *
+ * @return a reference to the {@code Policy} that was associated with the request.
+ */
+ public Policy getPolicy()
+ {
+ return policy;
+ }
+
+ /**
+ * <p>
+ * Sets the {@code Policy} in the response. The policy specifies defaults that can be overridden by the previous
+ * properties.
+ * </p>
+ *
+ * @param policy the {@code Policy} instance to be set.
+ */
+ public void setPolicy(Policy policy)
+ {
+ this.policy = policy;
+ this.delegate.getAny().add(policy);
+ }
+
+ /**
+ * <p>
+ * Obtains the reference to the {@code Policy} that was associated with the request.
+ * </p>
+ *
+ * @return a {@code PolicyReference} that specifies where the {@code Policy} can be found.
+ */
+ public PolicyReference getPolicyReference()
+ {
+ return policyReference;
+ }
+
+ /**
+ * <p>
+ * Sets the reference to the {@code Policy} that was associated with the request.
+ * </p>
+ *
+ * @param policyReference the {@code PolicyReference} object to be set.
+ */
+ public void setPolicyReference(PolicyReference policyReference)
+ {
+ this.policyReference = policyReference;
+ this.delegate.getAny().add(policyReference);
+ }
+
+ /**
+ * <p>
+ * Obtains the list of request elements that are not part of the standard content model.
+ * </p>
+ *
+ * @return a {@code List<Object>} containing the extension elements.
+ */
+ public List<Object> getExtensionElements()
+ {
+ return Collections.unmodifiableList(this.extensionElements);
+ }
+
+ /**
+ * <p>
+ * Obtains the response context.
+ * </p>
+ *
+ * @return a {@code String} that identifies the original request.
+ */
+ public String getContext()
+ {
+ return this.delegate.getContext();
+ }
+
+ /**
+ * <p>
+ * Sets the response context.
+ * </p>
+ *
+ * @param context a {@code String} that identifies the original request.
+ */
+ public void setContext(String context)
+ {
+ this.delegate.setContext(context);
+ }
+
+ /**
+ * <p>
+ * Obtains a map that contains attributes that aren't bound to any typed property on the response. This is a live
+ * reference, so attributes can be added/changed/removed directly. For this reason, there is no setter method.
+ * </p>
+ *
+ * @return a {@code Map<QName, String>} that contains the attributes.
+ */
+ public Map<QName, String> getOtherAttributes()
+ {
+ return this.delegate.getOtherAttributes();
+ }
+
+ /**
+ * <p>
+ * Gets a reference to the list that holds all response element values.
+ * </p>
+ *
+ * @return a {@code List<Object>} containing all values specified in the response.
+ */
+ public List<Object> getAny()
+ {
+ return this.delegate.getAny();
+ }
+
+ /**
+ * <p>
+ * Obtains a reference to the {@code RequestSecurityTokenResponseType} delegate.
+ * </p>
+ *
+ * @return a reference to the delegate instance.
+ */
+ public RequestSecurityTokenResponseType getDelegate()
+ {
+ return this.delegate;
+ }
+}
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenResponseCollection.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenResponseCollection.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/protocol/RequestSecurityTokenResponseCollection.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.wstrust.protocol;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponseCollectionType;
+import org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponseType;
+
+/**
+ * <p>
+ * This class represents a WS-Trust {@code RequestSecurityTokenResponseCollection}. It wraps the JAXB representation of
+ * the security token collection response.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class RequestSecurityTokenResponseCollection implements BaseRequestSecurityTokenResponse
+{
+
+ private final RequestSecurityTokenResponseCollectionType delegate;
+
+ private final List<RequestSecurityTokenResponse> requestSecurityTokenResponses;
+
+ /**
+ * <p>
+ * Creates an instance of {@code RequestSecurityTokenResponseCollection}.
+ * </p>
+ */
+ public RequestSecurityTokenResponseCollection()
+ {
+ this.requestSecurityTokenResponses = new ArrayList<RequestSecurityTokenResponse>();
+ this.delegate = new RequestSecurityTokenResponseCollectionType();
+ }
+
+ /**
+ * <p>
+ * Creates an instance of {@code RequestSecurityTokenResponseCollection} using the specified delegate.
+ * </p>
+ *
+ * @param delegate the JAXB {@code RequestSecurityTokenResponseCollectionType} that represents a WS-Trust request
+ * collection.
+ */
+ public RequestSecurityTokenResponseCollection(RequestSecurityTokenResponseCollectionType delegate)
+ {
+ this.delegate = delegate;
+ this.requestSecurityTokenResponses = new ArrayList<RequestSecurityTokenResponse>();
+ for (RequestSecurityTokenResponseType response : delegate.getRequestSecurityTokenResponse())
+ this.requestSecurityTokenResponses.add(new RequestSecurityTokenResponse(response));
+ }
+
+ /**
+ * <p>
+ * Obtains the collection of {@code RequestSecurityTokenResponse} objects. The returned collection is immutable, so
+ * addition or removal of requests must be carried by the appropriate add/remove methods.
+ * </p>
+ *
+ * @return a {@code List<RequestSecurityToken>} containing the token requests.
+ */
+ public List<RequestSecurityTokenResponse> getRequestSecurityTokenResponses()
+ {
+ return Collections.unmodifiableList(this.requestSecurityTokenResponses);
+ }
+
+ /**
+ * <p>
+ * Adds the specified {@code RequestSecurityTokenResponse} object to the collection of token requests.
+ * </p>
+ *
+ * @param request the {@code RequestSecurityTokenResponse} to be added.
+ */
+ public void addRequestSecurityTokenResponse(RequestSecurityTokenResponse response)
+ {
+ this.delegate.getRequestSecurityTokenResponse().add(response.getDelegate());
+ this.requestSecurityTokenResponses.add(response);
+ }
+
+ /**
+ * <p>
+ * Removes the specified {@code RequestSecurityTokenResponse} object from the collection of token requests.
+ * </p>
+ *
+ * @param request the {@code RequestSecurityTokenResponse} to be removed.
+ */
+ public void removeRequestSecurityTokenResponse(RequestSecurityTokenResponse response)
+ {
+ this.delegate.getRequestSecurityTokenResponse().remove(response.getDelegate());
+ this.requestSecurityTokenResponses.remove(response);
+ }
+
+ /**
+ * <p>
+ * Obtains a reference to the {@code RequestSecurityTokenResponseCollectionType} delegate.
+ * </p>
+ *
+ * @return a reference to the delegate instance.
+ */
+ public RequestSecurityTokenResponseCollectionType getDelegate()
+ {
+ return this.delegate;
+ }
+
+}
Modified: identity-federation/trunk/identity-fed-core/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-core/.classpath 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-fed-core/.classpath 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,15 +1,20 @@
-<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="src" path="src/test/java"/>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity-fed-model"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-xacml/2.0.3-SNAPSHOT/jboss-xacml-2.0.3-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
- <classpathentry kind="output" path="target-eclipse"/>
-</classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+ <classpathentry kind="src" path="/jboss-identity-fed-model"/>
+ <classpathentry kind="src" path="/jboss-identity-xmlsec-model"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
+</classpath>
\ No newline at end of file
Modified: identity-federation/trunk/identity-fed-core/.project
===================================================================
--- identity-federation/trunk/identity-fed-core/.project 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-fed-core/.project 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,17 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>identity-fed-core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+ <name>jboss-identity-fed-core</name>
+ <comment>JBoss Identity Federation Core contains the core infrastructure code</comment>
+ <projects>
+ <project>jboss-identity-fed-model</project>
+ <project>jboss-identity-xmlsec-model</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Modified: identity-federation/trunk/identity-fed-model/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-model/.classpath 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-fed-model/.classpath 2009-02-09 18:47:40 UTC (rev 311)
@@ -7,32 +7,14 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
<classpathentry kind="var" path="M2_REPO/apache-logging/commons-logging-api/1.0.3/commons-logging-api-1.0.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/javolution/4.1.0/javolution-4.1.0.jar"/>
<classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.4/jaxb-impl-2.1.4.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.4/jaxb-impl-2.1.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-xjc/2.1.4/jaxb-xjc-2.1.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/identity/jboss-identity-xmlsec-model/1.0.0-SNAPSHOT/jboss-identity-xmlsec-model-1.0.0-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/identity/jboss-identity-xmlsec-model/1.0.0-SNAPSHOT/jboss-identity-xmlsec-model-1.0.0-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-sunxacml/2.0.3-SNAPSHOT/jboss-sunxacml-2.0.3-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/security/jboss-sunxacml/2.0.3-SNAPSHOT/jboss-sunxacml-2.0.3-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-xacml/2.0.3-SNAPSHOT/jboss-xacml-2.0.3-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/security/jboss-xacml/2.0.3-SNAPSHOT/jboss-xacml-2.0.3-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-xacml-saml/2.0.3-SNAPSHOT/jboss-xacml-saml-2.0.3-SNAPSHOT.jar" sourcepath="M2_REPO/org/jboss/security/jboss-xacml-saml/2.0.3-SNAPSHOT/jboss-xacml-saml-2.0.3-SNAPSHOT-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/net/sf/joda-time/1.4/joda-time-1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
+ <classpathentry kind="src" path="/jboss-identity-xmlsec-model"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/security/jbossxacml/2.0.3.CR1/jbossxacml-2.0.3.CR1.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
<classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar"/>
- <classpathentry kind="var" path="M2_REPO/opensaml/opensaml/2.2.0/opensaml-2.2.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/opensaml/openws/1.2.0/openws-1.2.0.jar"/>
<classpathentry kind="var" path="M2_REPO/apache-xalan/serializer/2.7.0.patch01-brew/serializer-2.7.0.patch01-brew.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.3/slf4j-log4j12-1.4.3.jar"/>
<classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/velocity/velocity-dep/1.5/velocity-dep-1.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xalan/xalan/j_2.7.0/xalan-j_2.7.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-xmlsec/xmlsec/1.3.0/xmlsec-1.3.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/opensaml/xmltooling/1.1.0/xmltooling-1.1.0.jar"/>
</classpath>
\ No newline at end of file
Modified: identity-federation/trunk/identity-fed-model/.project
===================================================================
--- identity-federation/trunk/identity-fed-model/.project 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-fed-model/.project 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,7 +1,9 @@
<projectDescription>
<name>jboss-identity-fed-model</name>
<comment>JBoss Identity Federation Model contains the JAXB2 model.</comment>
- <projects/>
+ <projects>
+ <project>jboss-identity-xmlsec-model</project>
+ </projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
Modified: identity-federation/trunk/identity-fed-model/src/test/java/org/jboss/test/identity/federation/ws/trust/UnmarshallingTestCase.java
===================================================================
--- identity-federation/trunk/identity-fed-model/src/test/java/org/jboss/test/identity/federation/ws/trust/UnmarshallingTestCase.java 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-fed-model/src/test/java/org/jboss/test/identity/federation/ws/trust/UnmarshallingTestCase.java 2009-02-09 18:47:40 UTC (rev 311)
@@ -54,7 +54,7 @@
@SuppressWarnings("unchecked")
public void testUnmarshallTokenRequest() throws Exception
{
- JAXBContext context = JAXBContext.newInstance("org.jboss.identity.federation.ws.trust");
+ JAXBContext context = JAXBContext.newInstance("org.jboss.identity.federation.ws.policy:org.jboss.identity.federation.ws.trust");
Unmarshaller unmarshaller = context.createUnmarshaller();
// this.setValidatingSchema("/schema/wstrust/v1_3/ws-trust-1.3.xsd", unmarshaller);
Modified: identity-federation/trunk/identity-xmlsecmodel/.classpath
===================================================================
--- identity-federation/trunk/identity-xmlsecmodel/.classpath 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-xmlsecmodel/.classpath 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,13 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
-
- <classpathentry kind="output" path="target-eclipse"/>
-</classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar" sourcepath="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/apache-log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/codehaus-stax/stax/1.1.1/stax-1.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+</classpath>
\ No newline at end of file
Modified: identity-federation/trunk/identity-xmlsecmodel/.project
===================================================================
--- identity-federation/trunk/identity-xmlsecmodel/.project 2009-02-09 05:17:32 UTC (rev 310)
+++ identity-federation/trunk/identity-xmlsecmodel/.project 2009-02-09 18:47:40 UTC (rev 311)
@@ -1,17 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>identity-xmlsec-model</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+ <name>jboss-identity-xmlsec-model</name>
+ <comment>JBoss Identity Federation XML Security Model contains the JAXB2 model for W3C XML Signature and XML Encryption specifications.</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
15 years, 2 months
JBoss Identity SVN: r310 - in identity-federation/trunk: identity-fed-model and 1 other directories.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-09 00:17:32 -0500 (Mon, 09 Feb 2009)
New Revision: 310
Modified:
identity-federation/trunk/identity-fed-api/pom.xml
identity-federation/trunk/identity-fed-model/pom.xml
identity-federation/trunk/parent/pom.xml
Log:
update dependencies
Modified: identity-federation/trunk/identity-fed-api/pom.xml
===================================================================
--- identity-federation/trunk/identity-fed-api/pom.xml 2009-02-09 03:45:51 UTC (rev 309)
+++ identity-federation/trunk/identity-fed-api/pom.xml 2009-02-09 05:17:32 UTC (rev 310)
@@ -68,6 +68,10 @@
<version>1.0</version>
</dependency>
<dependency>
+ <groupId>org.apache</groupId>
+ <artifactId>xmlsec</artifactId>
+ </dependency>
+ <dependency>
<groupId>sun-jaf</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
Modified: identity-federation/trunk/identity-fed-model/pom.xml
===================================================================
--- identity-federation/trunk/identity-fed-model/pom.xml 2009-02-09 03:45:51 UTC (rev 309)
+++ identity-federation/trunk/identity-fed-model/pom.xml 2009-02-09 05:17:32 UTC (rev 310)
@@ -58,7 +58,7 @@
<artifactId>log4j</artifactId>
</dependency>
<dependency>
- <groupId>apache-xmlsec</groupId>
+ <groupId>org.apache</groupId>
<artifactId>xmlsec</artifactId>
</dependency>
<dependency>
@@ -66,14 +66,18 @@
<artifactId>commons-logging-api</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.security</groupId>
- <artifactId>jboss-xacml-saml</artifactId>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>sun-jaxb</groupId>
- <artifactId>jaxb-api</artifactId>
+ <artifactId>jaxb-impl</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbossxacml</artifactId>
+ </dependency>
+ <dependency>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
<version>1.0</version>
Modified: identity-federation/trunk/parent/pom.xml
===================================================================
--- identity-federation/trunk/parent/pom.xml 2009-02-09 03:45:51 UTC (rev 309)
+++ identity-federation/trunk/parent/pom.xml 2009-02-09 05:17:32 UTC (rev 310)
@@ -101,9 +101,9 @@
<version>1.2.14</version>
</dependency>
<dependency>
- <groupId>apache-xmlsec</groupId>
+ <groupId>org.apache</groupId>
<artifactId>xmlsec</artifactId>
- <version>1.3.0</version>
+ <version>1.4.1</version>
</dependency>
<dependency>
<groupId>apache-logging</groupId>
@@ -111,11 +111,6 @@
<version>1.0.3</version>
</dependency>
<dependency>
- <groupId>org.jboss.security</groupId>
- <artifactId>jboss-xacml-saml</artifactId>
- <version>2.0.3.alpha</version>
- </dependency>
- <dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
@@ -125,6 +120,16 @@
<artifactId>jaxb-api</artifactId>
<version>2.1.9</version>
</dependency>
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbossxacml</artifactId>
+ <version>2.0.3.CR1</version>
+ </dependency>
</dependencies>
</dependencyManagement>
15 years, 2 months
JBoss Identity SVN: r309 - identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-08 22:45:51 -0500 (Sun, 08 Feb 2009)
New Revision: 309
Added:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthPropertyType.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncAlgoType.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncryptionType.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDPType.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProviderType.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValueType.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ProviderType.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SPType.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TrustType.java
Removed:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthProperty.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDP.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProvider.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValue.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Provider.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SP.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Trust.java
Log:
config changes
Deleted: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthProperty.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthProperty.java 2009-02-09 03:43:49 UTC (rev 308)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthProperty.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -1,39 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
-//
-
-
-package org.jboss.identity.federation.bindings.config;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for AuthProperty complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="AuthProperty">
- * <complexContent>
- * <extension base="{urn:jboss:identity-federation:config:1.0}KeyValue">
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "AuthProperty")
-public class AuthProperty
- extends KeyValue
-{
-
-
-}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthPropertyType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthPropertyType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthPropertyType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,39 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for AuthPropertyType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="AuthPropertyType">
+ * <complexContent>
+ * <extension base="{urn:jboss:identity-federation:config:1.0}KeyValueType">
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "AuthPropertyType")
+public class AuthPropertyType
+ extends KeyValueType
+{
+
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncAlgoType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncAlgoType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncAlgoType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,59 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlEnumValue;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for EncAlgoType.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * <pre>
+ * <simpleType name="EncAlgoType">
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ * <enumeration value="AES"/>
+ * <enumeration value="DES"/>
+ * <enumeration value="DESede"/>
+ * </restriction>
+ * </simpleType>
+ * </pre>
+ *
+ */
+@XmlType(name = "EncAlgoType")
+@XmlEnum
+public enum EncAlgoType {
+
+ AES("AES"),
+ DES("DES"),
+ @XmlEnumValue("DESede")
+ DE_SEDE("DESede");
+ private final String value;
+
+ EncAlgoType(String v) {
+ value = v;
+ }
+
+ public String value() {
+ return value;
+ }
+
+ public static EncAlgoType fromValue(String v) {
+ for (EncAlgoType c: EncAlgoType.values()) {
+ if (c.value.equals(v)) {
+ return c;
+ }
+ }
+ throw new IllegalArgumentException(v);
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncryptionType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncryptionType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncryptionType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,89 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for EncryptionType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="EncryptionType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="EncAlgo" type="{urn:jboss:identity-federation:config:1.0}EncAlgoType"/>
+ * <element name="KeySize" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "EncryptionType", propOrder = {
+ "encAlgo",
+ "keySize"
+})
+public class EncryptionType {
+
+ @XmlElement(name = "EncAlgo", required = true)
+ protected EncAlgoType encAlgo;
+ @XmlElement(name = "KeySize")
+ protected int keySize;
+
+ /**
+ * Gets the value of the encAlgo property.
+ *
+ * @return
+ * possible object is
+ * {@link EncAlgoType }
+ *
+ */
+ public EncAlgoType getEncAlgo() {
+ return encAlgo;
+ }
+
+ /**
+ * Sets the value of the encAlgo property.
+ *
+ * @param value
+ * allowed object is
+ * {@link EncAlgoType }
+ *
+ */
+ public void setEncAlgo(EncAlgoType value) {
+ this.encAlgo = value;
+ }
+
+ /**
+ * Gets the value of the keySize property.
+ *
+ */
+ public int getKeySize() {
+ return keySize;
+ }
+
+ /**
+ * Sets the value of the keySize property.
+ *
+ */
+ public void setKeySize(int value) {
+ this.keySize = value;
+ }
+
+}
Deleted: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDP.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDP.java 2009-02-09 03:43:49 UTC (rev 308)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDP.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -1,107 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
-//
-
-
-package org.jboss.identity.federation.bindings.config;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- *
- * IDP Type defines the configuration for an Identity
- * Provider.
- *
- *
- * <p>Java class for IDP complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="IDP">
- * <complexContent>
- * <extension base="{urn:jboss:identity-federation:config:1.0}Provider">
- * <attribute name="AssertionValidity" type="{http://www.w3.org/2001/XMLSchema}long" default="5000" />
- * <attribute name="RoleGenerator" type="{http://www.w3.org/2001/XMLSchema}string" default="org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator" />
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "IDP")
-public class IDP
- extends Provider
-{
-
- @XmlAttribute(name = "AssertionValidity")
- protected Long assertionValidity;
- @XmlAttribute(name = "RoleGenerator")
- protected String roleGenerator;
-
- /**
- * Gets the value of the assertionValidity property.
- *
- * @return
- * possible object is
- * {@link Long }
- *
- */
- public long getAssertionValidity() {
- if (assertionValidity == null) {
- return 5000L;
- } else {
- return assertionValidity;
- }
- }
-
- /**
- * Sets the value of the assertionValidity property.
- *
- * @param value
- * allowed object is
- * {@link Long }
- *
- */
- public void setAssertionValidity(Long value) {
- this.assertionValidity = value;
- }
-
- /**
- * Gets the value of the roleGenerator property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getRoleGenerator() {
- if (roleGenerator == null) {
- return "org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator";
- } else {
- return roleGenerator;
- }
- }
-
- /**
- * Sets the value of the roleGenerator property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setRoleGenerator(String value) {
- this.roleGenerator = value;
- }
-
-}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDPType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDPType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDPType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,170 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * IDP Type defines the configuration for an Identity
+ * Provider.
+ *
+ *
+ * <p>Java class for IDPType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="IDPType">
+ * <complexContent>
+ * <extension base="{urn:jboss:identity-federation:config:1.0}ProviderType">
+ * <sequence>
+ * <element name="Encryption" type="{urn:jboss:identity-federation:config:1.0}EncryptionType" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="AssertionValidity" type="{http://www.w3.org/2001/XMLSchema}long" default="300000" />
+ * <attribute name="RoleGenerator" type="{http://www.w3.org/2001/XMLSchema}string" default="org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator" />
+ * <attribute name="Encrypt" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "IDPType", propOrder = {
+ "encryption"
+})
+public class IDPType
+ extends ProviderType
+{
+
+ @XmlElement(name = "Encryption")
+ protected EncryptionType encryption;
+ @XmlAttribute(name = "AssertionValidity")
+ protected Long assertionValidity;
+ @XmlAttribute(name = "RoleGenerator")
+ protected String roleGenerator;
+ @XmlAttribute(name = "Encrypt")
+ protected Boolean encrypt;
+
+ /**
+ * Gets the value of the encryption property.
+ *
+ * @return
+ * possible object is
+ * {@link EncryptionType }
+ *
+ */
+ public EncryptionType getEncryption() {
+ return encryption;
+ }
+
+ /**
+ * Sets the value of the encryption property.
+ *
+ * @param value
+ * allowed object is
+ * {@link EncryptionType }
+ *
+ */
+ public void setEncryption(EncryptionType value) {
+ this.encryption = value;
+ }
+
+ /**
+ * Gets the value of the assertionValidity property.
+ *
+ * @return
+ * possible object is
+ * {@link Long }
+ *
+ */
+ public long getAssertionValidity() {
+ if (assertionValidity == null) {
+ return 300000L;
+ } else {
+ return assertionValidity;
+ }
+ }
+
+ /**
+ * Sets the value of the assertionValidity property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Long }
+ *
+ */
+ public void setAssertionValidity(Long value) {
+ this.assertionValidity = value;
+ }
+
+ /**
+ * Gets the value of the roleGenerator property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRoleGenerator() {
+ if (roleGenerator == null) {
+ return "org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator";
+ } else {
+ return roleGenerator;
+ }
+ }
+
+ /**
+ * Sets the value of the roleGenerator property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRoleGenerator(String value) {
+ this.roleGenerator = value;
+ }
+
+ /**
+ * Gets the value of the encrypt property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isEncrypt() {
+ if (encrypt == null) {
+ return false;
+ } else {
+ return encrypt;
+ }
+ }
+
+ /**
+ * Sets the value of the encrypt property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setEncrypt(Boolean value) {
+ this.encrypt = value;
+ }
+
+}
Deleted: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProvider.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProvider.java 2009-02-09 03:43:49 UTC (rev 308)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProvider.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -1,169 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
-//
-
-
-package org.jboss.identity.federation.bindings.config;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- *
- * Source of the Signing and Validating Key
- *
- *
- * <p>Java class for KeyProvider complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="KeyProvider">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="Auth" type="{urn:jboss:identity-federation:config:1.0}AuthProperty" maxOccurs="unbounded" minOccurs="0"/>
- * <element name="ValidatingAlias" type="{urn:jboss:identity-federation:config:1.0}KeyValue" maxOccurs="unbounded" minOccurs="0"/>
- * <element name="SigningAlias" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- * </sequence>
- * <attribute name="ClassName" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "KeyProvider", propOrder = {
- "auth",
- "validatingAlias",
- "signingAlias"
-})
-public class KeyProvider {
-
- @XmlElement(name = "Auth")
- protected List<AuthProperty> auth;
- @XmlElement(name = "ValidatingAlias")
- protected List<KeyValue> validatingAlias;
- @XmlElement(name = "SigningAlias")
- protected String signingAlias;
- @XmlAttribute(name = "ClassName")
- protected String className;
-
- /**
- * Gets the value of the auth property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the auth property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAuth().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link AuthProperty }
- *
- *
- */
- public List<AuthProperty> getAuth() {
- if (auth == null) {
- auth = new ArrayList<AuthProperty>();
- }
- return this.auth;
- }
-
- /**
- * Gets the value of the validatingAlias property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the validatingAlias property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getValidatingAlias().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link KeyValue }
- *
- *
- */
- public List<KeyValue> getValidatingAlias() {
- if (validatingAlias == null) {
- validatingAlias = new ArrayList<KeyValue>();
- }
- return this.validatingAlias;
- }
-
- /**
- * Gets the value of the signingAlias property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getSigningAlias() {
- return signingAlias;
- }
-
- /**
- * Sets the value of the signingAlias property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setSigningAlias(String value) {
- this.signingAlias = value;
- }
-
- /**
- * Gets the value of the className property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
-}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProviderType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProviderType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProviderType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,169 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * Source of the Signing and Validating Key
+ *
+ *
+ * <p>Java class for KeyProviderType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="KeyProviderType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Auth" type="{urn:jboss:identity-federation:config:1.0}AuthPropertyType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="ValidatingAlias" type="{urn:jboss:identity-federation:config:1.0}KeyValueType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="SigningAlias" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="ClassName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "KeyProviderType", propOrder = {
+ "auth",
+ "validatingAlias",
+ "signingAlias"
+})
+public class KeyProviderType {
+
+ @XmlElement(name = "Auth")
+ protected List<AuthPropertyType> auth;
+ @XmlElement(name = "ValidatingAlias")
+ protected List<KeyValueType> validatingAlias;
+ @XmlElement(name = "SigningAlias")
+ protected String signingAlias;
+ @XmlAttribute(name = "ClassName")
+ protected String className;
+
+ /**
+ * Gets the value of the auth property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the auth property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAuth().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link AuthPropertyType }
+ *
+ *
+ */
+ public List<AuthPropertyType> getAuth() {
+ if (auth == null) {
+ auth = new ArrayList<AuthPropertyType>();
+ }
+ return this.auth;
+ }
+
+ /**
+ * Gets the value of the validatingAlias property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the validatingAlias property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getValidatingAlias().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link KeyValueType }
+ *
+ *
+ */
+ public List<KeyValueType> getValidatingAlias() {
+ if (validatingAlias == null) {
+ validatingAlias = new ArrayList<KeyValueType>();
+ }
+ return this.validatingAlias;
+ }
+
+ /**
+ * Gets the value of the signingAlias property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSigningAlias() {
+ return signingAlias;
+ }
+
+ /**
+ * Sets the value of the signingAlias property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSigningAlias(String value) {
+ this.signingAlias = value;
+ }
+
+ /**
+ * Gets the value of the className property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getClassName() {
+ return className;
+ }
+
+ /**
+ * Sets the value of the className property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setClassName(String value) {
+ this.className = value;
+ }
+
+}
Deleted: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValue.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValue.java 2009-02-09 03:43:49 UTC (rev 308)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValue.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -1,96 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
-//
-
-
-package org.jboss.identity.federation.bindings.config;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for KeyValue complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="KeyValue">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="Key" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="Value" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "KeyValue")
-@XmlSeeAlso({
- AuthProperty.class
-})
-public class KeyValue {
-
- @XmlAttribute(name = "Key")
- protected String key;
- @XmlAttribute(name = "Value")
- protected String value;
-
- /**
- * Gets the value of the key property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Sets the value of the key property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setKey(String value) {
- this.key = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
-
-}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValueType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValueType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValueType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,96 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for KeyValueType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="KeyValueType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="Key" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Value" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "KeyValueType")
+@XmlSeeAlso({
+ AuthPropertyType.class
+})
+public class KeyValueType {
+
+ @XmlAttribute(name = "Key")
+ protected String key;
+ @XmlAttribute(name = "Value")
+ protected String value;
+
+ /**
+ * Gets the value of the key property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * Sets the value of the key property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setKey(String value) {
+ this.key = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
Deleted: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Provider.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Provider.java 2009-02-09 03:43:49 UTC (rev 308)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Provider.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -1,132 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
-//
-
-
-package org.jboss.identity.federation.bindings.config;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * Base Type for IDP and SP
- *
- * <p>Java class for Provider complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Provider">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="IdentityURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * <element name="Trust" type="{urn:jboss:identity-federation:config:1.0}Trust"/>
- * <element name="KeyProvider" type="{urn:jboss:identity-federation:config:1.0}KeyProvider" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "Provider", propOrder = {
- "identityURL",
- "trust",
- "keyProvider"
-})
-@XmlSeeAlso({
- IDP.class,
- SP.class
-})
-public class Provider {
-
- @XmlElement(name = "IdentityURL", required = true)
- protected String identityURL;
- @XmlElement(name = "Trust")
- protected Trust trust;
- @XmlElement(name = "KeyProvider")
- protected KeyProvider keyProvider;
-
- /**
- * Gets the value of the identityURL property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getIdentityURL() {
- return identityURL;
- }
-
- /**
- * Sets the value of the identityURL property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setIdentityURL(String value) {
- this.identityURL = value;
- }
-
- /**
- * Gets the value of the trust property.
- *
- * @return
- * possible object is
- * {@link Trust }
- *
- */
- public Trust getTrust() {
- return trust;
- }
-
- /**
- * Sets the value of the trust property.
- *
- * @param value
- * allowed object is
- * {@link Trust }
- *
- */
- public void setTrust(Trust value) {
- this.trust = value;
- }
-
- /**
- * Gets the value of the keyProvider property.
- *
- * @return
- * possible object is
- * {@link KeyProvider }
- *
- */
- public KeyProvider getKeyProvider() {
- return keyProvider;
- }
-
- /**
- * Sets the value of the keyProvider property.
- *
- * @param value
- * allowed object is
- * {@link KeyProvider }
- *
- */
- public void setKeyProvider(KeyProvider value) {
- this.keyProvider = value;
- }
-
-}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ProviderType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ProviderType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ProviderType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,132 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Base Type for IDP and SP
+ *
+ * <p>Java class for ProviderType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="ProviderType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="IdentityURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Trust" type="{urn:jboss:identity-federation:config:1.0}TrustType" minOccurs="0"/>
+ * <element name="KeyProvider" type="{urn:jboss:identity-federation:config:1.0}KeyProviderType" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "ProviderType", propOrder = {
+ "identityURL",
+ "trust",
+ "keyProvider"
+})
+@XmlSeeAlso({
+ IDPType.class,
+ SPType.class
+})
+public class ProviderType {
+
+ @XmlElement(name = "IdentityURL", required = true)
+ protected String identityURL;
+ @XmlElement(name = "Trust")
+ protected TrustType trust;
+ @XmlElement(name = "KeyProvider")
+ protected KeyProviderType keyProvider;
+
+ /**
+ * Gets the value of the identityURL property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIdentityURL() {
+ return identityURL;
+ }
+
+ /**
+ * Sets the value of the identityURL property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIdentityURL(String value) {
+ this.identityURL = value;
+ }
+
+ /**
+ * Gets the value of the trust property.
+ *
+ * @return
+ * possible object is
+ * {@link TrustType }
+ *
+ */
+ public TrustType getTrust() {
+ return trust;
+ }
+
+ /**
+ * Sets the value of the trust property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TrustType }
+ *
+ */
+ public void setTrust(TrustType value) {
+ this.trust = value;
+ }
+
+ /**
+ * Gets the value of the keyProvider property.
+ *
+ * @return
+ * possible object is
+ * {@link KeyProviderType }
+ *
+ */
+ public KeyProviderType getKeyProvider() {
+ return keyProvider;
+ }
+
+ /**
+ * Sets the value of the keyProvider property.
+ *
+ * @param value
+ * allowed object is
+ * {@link KeyProviderType }
+ *
+ */
+ public void setKeyProvider(KeyProviderType value) {
+ this.keyProvider = value;
+ }
+
+}
Deleted: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SP.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SP.java 2009-02-09 03:43:49 UTC (rev 308)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SP.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -1,73 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
-//
-
-
-package org.jboss.identity.federation.bindings.config;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * Service Provider Type
- *
- * <p>Java class for SP complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="SP">
- * <complexContent>
- * <extension base="{urn:jboss:identity-federation:config:1.0}Provider">
- * <sequence>
- * <element name="ServiceURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * </sequence>
- * </extension>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "SP", propOrder = {
- "serviceURL"
-})
-public class SP
- extends Provider
-{
-
- @XmlElement(name = "ServiceURL", required = true)
- protected String serviceURL;
-
- /**
- * Gets the value of the serviceURL property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getServiceURL() {
- return serviceURL;
- }
-
- /**
- * Sets the value of the serviceURL property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setServiceURL(String value) {
- this.serviceURL = value;
- }
-
-}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SPType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SPType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SPType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,73 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Service Provider Type
+ *
+ * <p>Java class for SPType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="SPType">
+ * <complexContent>
+ * <extension base="{urn:jboss:identity-federation:config:1.0}ProviderType">
+ * <sequence>
+ * <element name="ServiceURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "SPType", propOrder = {
+ "serviceURL"
+})
+public class SPType
+ extends ProviderType
+{
+
+ @XmlElement(name = "ServiceURL", required = true)
+ protected String serviceURL;
+
+ /**
+ * Gets the value of the serviceURL property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Sets the value of the serviceURL property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setServiceURL(String value) {
+ this.serviceURL = value;
+ }
+
+}
Deleted: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Trust.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Trust.java 2009-02-09 03:43:49 UTC (rev 308)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Trust.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -1,71 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
-//
-
-
-package org.jboss.identity.federation.bindings.config;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * Aspects involved in trust decisions such as the domains that the IDP or the Service Provider trusts.
- *
- * <p>Java class for Trust complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="Trust">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="Domains" type="{http://www.w3.org/2001/XMLSchema}string"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-(a)XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "Trust", propOrder = {
- "domains"
-})
-public class Trust {
-
- @XmlElement(name = "Domains", required = true)
- protected String domains;
-
- /**
- * Gets the value of the domains property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getDomains() {
- return domains;
- }
-
- /**
- * Sets the value of the domains property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setDomains(String value) {
- this.domains = value;
- }
-
-}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TrustType.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TrustType.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TrustType.java 2009-02-09 03:45:51 UTC (rev 309)
@@ -0,0 +1,71 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.02.04 at 09:20:44 PM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Aspects involved in trust decisions such as the domains that the IDP or the Service Provider trusts.
+ *
+ * <p>Java class for TrustType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="TrustType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Domains" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "TrustType", propOrder = {
+ "domains"
+})
+public class TrustType {
+
+ @XmlElement(name = "Domains", required = true)
+ protected String domains;
+
+ /**
+ * Gets the value of the domains property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDomains() {
+ return domains;
+ }
+
+ /**
+ * Sets the value of the domains property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDomains(String value) {
+ this.domains = value;
+ }
+
+}
15 years, 2 months
JBoss Identity SVN: r308 - in identity-federation/trunk: identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config and 16 other directories.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-08 22:43:49 -0500 (Sun, 08 Feb 2009)
New Revision: 308
Added:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/cert/EncryptionKeyUtil.java
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossEncryptionConstants.java
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/xmlenc/
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/xmlenc/factories/
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/xmlenc/factories/XMLEncryptionFactory.java
Modified:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyManager.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/KeyStoreKeyManager.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/idp/IDPRedirectValve.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/idp/IDPRedirectWithSignatureValve.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPRedirectFormAuthenticator.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPRedirectSignatureFormAuthenticator.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPUtil.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/ValveUtil.java
identity-federation/trunk/identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd
identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/ConfigUnitTestCase.java
identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-2.xml
identity-federation/trunk/identity-fed-core/.classpath
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossSAMLURIConstants.java
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/SAMLProtocolFactory.java
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/DocumentUtil.java
identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/JAXBElementMappingUtil.java
identity-federation/trunk/pom.xml
Log:
JBID-47: xml enc support
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
+// Generated on: 2009.02.04 at 09:20:44 PM CST
//
@@ -32,7 +32,6 @@
public class ObjectFactory {
private final static QName _JBossIDP_QNAME = new QName("urn:jboss:identity-federation:config:1.0", "JBossIDP");
-
private final static QName _JBossSP_QNAME = new QName("urn:jboss:identity-federation:config:1.0", "JBossSP");
/**
@@ -43,76 +42,85 @@
}
/**
- * Create an instance of {@link SP }
+ * Create an instance of {@link EncryptionType }
*
*/
- public SP createSP() {
- return new SP();
+ public EncryptionType createEncryptionType() {
+ return new EncryptionType();
}
/**
- * Create an instance of {@link KeyProvider }
+ * Create an instance of {@link TrustType }
*
*/
- public KeyProvider createKeyProvider() {
- return new KeyProvider();
+ public TrustType createTrustType() {
+ return new TrustType();
}
/**
- * Create an instance of {@link AuthProperty }
+ * Create an instance of {@link SPType }
*
*/
- public AuthProperty createAuthProperty() {
- return new AuthProperty();
+ public SPType createSPType() {
+ return new SPType();
}
/**
- * Create an instance of {@link Trust }
+ * Create an instance of {@link KeyValueType }
*
*/
- public Trust createTrust() {
- return new Trust();
+ public KeyValueType createKeyValueType() {
+ return new KeyValueType();
}
/**
- * Create an instance of {@link Provider }
+ * Create an instance of {@link AuthPropertyType }
*
*/
- public Provider createProvider() {
- return new Provider();
+ public AuthPropertyType createAuthPropertyType() {
+ return new AuthPropertyType();
}
/**
- * Create an instance of {@link KeyValue }
+ * Create an instance of {@link ProviderType }
*
*/
- public KeyValue createKeyValue() {
- return new KeyValue();
+ public ProviderType createProviderType() {
+ return new ProviderType();
}
/**
- * Create an instance of {@link IDP }
+ * Create an instance of {@link KeyProviderType }
*
*/
- public IDP createIDP() {
- return new IDP();
+ public KeyProviderType createKeyProviderType() {
+ return new KeyProviderType();
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link IDP }{@code >}}
+ * Create an instance of {@link IDPType }
*
*/
+ public IDPType createIDPType() {
+ return new IDPType();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IDPType }{@code >}}
+ *
+ */
@XmlElementDecl(namespace = "urn:jboss:identity-federation:config:1.0", name = "JBossIDP")
- public JAXBElement<IDP> createJBossIDP(IDP value) {
- return new JAXBElement<IDP>(_JBossIDP_QNAME, IDP.class, null, value);
+ public JAXBElement<IDPType> createJBossIDP(IDPType value) {
+ return new JAXBElement<IDPType>(_JBossIDP_QNAME, IDPType.class, null, value);
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link SP }{@code >}}
+ * Create an instance of {@link JAXBElement }{@code <}{@link SPType }{@code >}}
*
*/
@XmlElementDecl(namespace = "urn:jboss:identity-federation:config:1.0", name = "JBossSP")
- public JAXBElement<SP> createJBossSP(SP value) {
- return new JAXBElement<SP>(_JBossSP_QNAME, SP.class, null, value);
+ public JAXBElement<SPType> createJBossSP(SPType value) {
+ return new JAXBElement<SPType>(_JBossSP_QNAME, SPType.class, null, value);
}
+
}
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.01.22 at 12:05:50 AM CST
+// Generated on: 2009.02.04 at 09:20:44 PM CST
//
@javax.xml.bind.annotation.XmlSchema(namespace = "urn:jboss:identity-federation:config:1.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyManager.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyManager.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/TrustKeyManager.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -25,9 +25,12 @@
import java.security.PublicKey;
import java.util.List;
-import org.jboss.identity.federation.bindings.config.AuthProperty;
-import org.jboss.identity.federation.bindings.config.KeyValue;
+import javax.crypto.SecretKey;
+import org.jboss.identity.federation.bindings.config.AuthPropertyType;
+import org.jboss.identity.federation.bindings.config.KeyValueType;
+
+
/**
* Key Manager interface used in trust decisions
* @author Anil.Saldhana(a)redhat.com
@@ -41,7 +44,7 @@
* @param authList
* @throws Exception
*/
- void setAuthProperties(List<AuthProperty> authList) throws Exception;
+ void setAuthProperties(List<AuthPropertyType> authList) throws Exception;
/**
* Set a list of (domain,alias) tuple to trust domains
@@ -50,7 +53,7 @@
* @param aliases
* @throws Exception
*/
- void setValidatingAlias(List<KeyValue> aliases) throws Exception;
+ void setValidatingAlias(List<KeyValueType> aliases) throws Exception;
/**
* Get the Signing Key
@@ -60,6 +63,17 @@
PrivateKey getSigningKey() throws Exception;
/**
+ * Given a domain, obtain a secret key
+ * @see {@code EncryptionKeyUtil}
+ * @param domain
+ * @param encryptionAlgorithm Encryption Algorithm
+ * @param keyLength length of keys
+ * @return
+ * @throws Exception
+ */
+ SecretKey getEncryptionKey(String domain, String encryptionAlgorithm, int keyLength) throws Exception;
+
+ /**
* Get the Validating Public Key of the domain
* @param domain
* @return
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/KeyStoreKeyManager.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/KeyStoreKeyManager.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/KeyStoreKeyManager.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -30,11 +30,15 @@
import java.security.UnrecoverableKeyException;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
-import org.jboss.identity.federation.bindings.config.AuthProperty;
-import org.jboss.identity.federation.bindings.config.KeyValue;
+import javax.crypto.SecretKey;
+
+import org.jboss.identity.federation.bindings.config.AuthPropertyType;
+import org.jboss.identity.federation.bindings.config.KeyValueType;
import org.jboss.identity.federation.bindings.interfaces.TrustKeyManager;
import org.jboss.identity.federation.bindings.util.ValveUtil;
+import org.jboss.identity.federation.bindings.util.cert.EncryptionKeyUtil;
import org.jboss.identity.federation.bindings.util.cert.KeyStoreUtil;
/**
@@ -44,6 +48,16 @@
*/
public class KeyStoreKeyManager implements TrustKeyManager
{
+ /**
+ * An map of secret keys alive only for the duration of the program.
+ * The keys are generated on the fly. If you sophisticated key
+ * storage, then a custom version of the {@code TrustKeyManager}
+ * needs to be written that either uses a secure thumb drive or
+ * a TPM module or a HSM module.
+ * Also see JBoss XMLKey.
+ */
+ private Map<String,SecretKey> keys = new HashMap<String,SecretKey>();
+
private HashMap<String,String> domainAliasMap = new HashMap<String,String>();
private HashMap<String,String> authPropsMap = new HashMap<String,String>();
@@ -101,9 +115,9 @@
/**
* @see TrustKeyManager#setAuthProperties(List)
*/
- public void setAuthProperties(List<AuthProperty> authList) throws Exception
+ public void setAuthProperties(List<AuthPropertyType> authList) throws Exception
{
- for(AuthProperty auth: authList)
+ for(AuthPropertyType auth: authList)
{
this.authPropsMap.put(auth.getKey(), auth.getValue());
}
@@ -123,14 +137,28 @@
/**
* @see TrustKeyManager#setValidatingAlias(List)
*/
- public void setValidatingAlias(List<KeyValue> aliases)
+ public void setValidatingAlias(List<KeyValueType> aliases)
{
- for(KeyValue alias: aliases)
+ for(KeyValueType alias: aliases)
{
domainAliasMap.put(alias.getKey(), alias.getValue());
}
}
+ /**
+ * @see TrustKeyManager#getEncryptionKey(String)
+ */
+ public SecretKey getEncryptionKey(String domain,String encryptionAlgorithm, int keyLength) throws Exception
+ {
+ SecretKey key = keys.get(domain);
+ if(key == null)
+ {
+ key = EncryptionKeyUtil.getSecretKey(encryptionAlgorithm, keyLength);
+ keys.put(domain, key);
+ }
+ return key;
+ }
+
private void setUpKeyStore() throws GeneralSecurityException, IOException
{
//Keystore URL/Pass can be either by configuration or on the HTTPS connector
@@ -145,5 +173,5 @@
InputStream is = ValveUtil.getKeyStoreInputStream(this.keyStoreURL);
ks = KeyStoreUtil.getKeyStore(is, keyStorePass.toCharArray());
- }
+ }
}
\ No newline at end of file
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/idp/IDPRedirectValve.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/idp/IDPRedirectValve.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/idp/IDPRedirectValve.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -43,8 +43,8 @@
import org.jboss.identity.federation.api.saml.v2.common.IDGenerator;
import org.jboss.identity.federation.api.saml.v2.request.SAML2Request;
import org.jboss.identity.federation.api.saml.v2.response.SAML2Response;
-import org.jboss.identity.federation.bindings.config.IDP;
-import org.jboss.identity.federation.bindings.config.Trust;
+import org.jboss.identity.federation.bindings.config.IDPType;
+import org.jboss.identity.federation.bindings.config.TrustType;
import org.jboss.identity.federation.bindings.interfaces.RoleGenerator;
import org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator;
import org.jboss.identity.federation.bindings.util.HTTPRedirectUtil;
@@ -70,11 +70,11 @@
{
private static Logger log = Logger.getLogger(IDPRedirectValve.class);
- protected IDP idpConfiguration = null;
+ protected IDPType idpConfiguration = null;
private RoleGenerator rg = new TomcatRoleGenerator();
- private long assertionValidity = 5000; // 5minutes in seconds
+ private long assertionValidity = 5000; // 5 seconds in miliseconds
private String identityURL = null;
@@ -157,7 +157,7 @@
try
{
String issuerDomain = ValveUtil.getDomain(issuer);
- Trust idpTrust = idpConfiguration.getTrust();
+ TrustType idpTrust = idpConfiguration.getTrust();
if(idpTrust != null)
{
String domainsTrusted = idpTrust.getDomains();
@@ -197,6 +197,13 @@
}
}
+ /**
+ * Generate a Destination URL for the HTTPRedirect binding
+ * with the saml response and relay state
+ * @param urlEncodedResponse
+ * @param urlEncodedRelayState
+ * @return
+ */
protected String getDestination(String urlEncodedResponse, String urlEncodedRelayState)
{
StringBuilder sb = new StringBuilder();
@@ -206,6 +213,12 @@
return sb.toString();
}
+ /**
+ * Validate the incoming Request
+ * @param request
+ * @return
+ * @throws Exception
+ */
protected boolean validate(Request request) throws Exception
{
return this.hasSAMLRequestMessage(request);
@@ -225,8 +238,14 @@
}
-
- private ResponseType getResponse(Request request, Principal userPrincipal) throws Exception
+ /**
+ * Create a response type
+ * @param request
+ * @param userPrincipal
+ * @return
+ * @throws Exception
+ */
+ protected ResponseType getResponse(Request request, Principal userPrincipal) throws Exception
{
ResponseType responseType = null;
@@ -268,8 +287,7 @@
//Add timed conditions
saml2Response.createTimedConditions(assertion, this.assertionValidity);
-
- log.debug("ResponseType = ");
+
//Lets see how the response looks like
if(log.isTraceEnabled())
{
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/idp/IDPRedirectWithSignatureValve.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/idp/IDPRedirectWithSignatureValve.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/idp/IDPRedirectWithSignatureValve.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -21,21 +21,38 @@
*/
package org.jboss.identity.federation.bindings.tomcat.idp;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URL;
+import java.security.Principal;
import java.security.PrivateKey;
import java.security.PublicKey;
+import javax.crypto.SecretKey;
+import javax.xml.namespace.QName;
+
import org.apache.catalina.LifecycleException;
import org.apache.catalina.connector.Request;
import org.apache.log4j.Logger;
-import org.jboss.identity.federation.bindings.config.KeyProvider;
+import org.jboss.identity.federation.api.saml.v2.response.SAML2Response;
+import org.jboss.identity.federation.api.util.XMLEncryptionUtil;
+import org.jboss.identity.federation.bindings.config.EncryptionType;
+import org.jboss.identity.federation.bindings.config.KeyProviderType;
import org.jboss.identity.federation.bindings.interfaces.TrustKeyManager;
import org.jboss.identity.federation.bindings.util.RedirectBindingSignatureUtil;
+import org.jboss.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
+import org.jboss.identity.federation.core.saml.v2.util.DocumentUtil;
import org.jboss.identity.federation.core.saml.v2.util.SignatureUtil;
+import org.jboss.identity.federation.saml.v2.assertion.EncryptedElementType;
+import org.jboss.identity.federation.saml.v2.protocol.ResponseType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
/**
* Valve at the Identity Provider that supports
* SAML2 HTTP/Redirect binding with digital signature support
+ * and xml encryption
* @author Anil.Saldhana(a)redhat.com
* @since Jan 14, 2009
*/
@@ -52,6 +69,11 @@
super();
}
+ /**
+ * Indicate whether the signature parameter in the request
+ * needs to be ignored
+ * @param val
+ */
public void setIgnoreSignature(String val)
{
if(val != null && val.length() > 0)
@@ -62,7 +84,7 @@
public void start() throws LifecycleException
{
super.start();
- KeyProvider keyProvider = this.idpConfiguration.getKeyProvider();
+ KeyProviderType keyProvider = this.idpConfiguration.getKeyProvider();
try
{
ClassLoader tcl = SecurityActions.getContextClassLoader();
@@ -83,6 +105,7 @@
log.trace("Key Provider=" + keyProvider.getClassName());
}
+ @Override
protected boolean validate(Request request) throws Exception
{
boolean result = super.validate(request);
@@ -137,4 +160,54 @@
throw new RuntimeException(e);
}
}
+
+ @Override
+ protected ResponseType getResponse(Request request, Principal userPrincipal) throws Exception
+ {
+ SAML2Response saml2Response = new SAML2Response();
+
+ ResponseType responseType = super.getResponse(request, userPrincipal);
+
+ //If there is a configuration to encrypt
+ if(this.idpConfiguration.isEncrypt())
+ {
+ //Need to encrypt the assertion
+ String sp = responseType.getDestination();
+ if(sp == null)
+ throw new IllegalStateException("Unable to handle encryption as SP url is null");
+ URL spurl = new URL(sp);
+ PublicKey publicKey = keyManager.getValidatingKey(spurl.getHost());
+ EncryptionType enc = idpConfiguration.getEncryption();
+ if(enc == null)
+ throw new IllegalStateException("EncryptionType not configured");
+ String encAlgo = enc.getEncAlgo().value();
+ int keyLength = enc.getKeySize();
+ //Generate a key on the fly
+ SecretKey sk = keyManager.getEncryptionKey(spurl.getHost(), encAlgo, keyLength);
+
+ StringWriter sw = new StringWriter();
+ saml2Response.marshall(responseType, sw);
+
+ Document responseDoc = DocumentUtil.getDocument(new StringReader(sw.toString()));
+
+ String assertionNS = JBossSAMLURIConstants.ASSERTION_NSURI.get();
+
+ QName assertionQName = new QName(assertionNS, "EncryptedAssertion", "saml");
+
+ Element encAssertion = XMLEncryptionUtil.encryptElementInDocument(responseDoc,
+ publicKey, sk, keyLength, assertionQName, true);
+
+
+ EncryptedElementType eet = saml2Response.getEncryptedAssertion(DocumentUtil.getNodeAsStream(encAssertion));
+ responseType.getAssertionOrEncryptedAssertion().set(0, eet);
+ }
+ //Lets see how the response looks like
+ if(log.isTraceEnabled())
+ {
+ StringWriter sw = new StringWriter();
+ saml2Response.marshall(responseType, sw);
+ log.trace("IDPRedirectValveWithSignature::Response="+sw.toString());
+ }
+ return responseType;
+ }
}
\ No newline at end of file
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPRedirectFormAuthenticator.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPRedirectFormAuthenticator.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPRedirectFormAuthenticator.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.security.Principal;
+import java.util.List;
import javax.servlet.ServletException;
@@ -41,8 +42,8 @@
import org.jboss.identity.federation.api.saml.v2.response.SAML2Response;
import org.jboss.identity.federation.api.util.Base64;
import org.jboss.identity.federation.api.util.DeflateUtil;
-import org.jboss.identity.federation.bindings.config.SP;
-import org.jboss.identity.federation.bindings.config.Trust;
+import org.jboss.identity.federation.bindings.config.SPType;
+import org.jboss.identity.federation.bindings.config.TrustType;
import org.jboss.identity.federation.bindings.jboss.DefaultJBossSubjectRegistration;
import org.jboss.identity.federation.bindings.jboss.JBossSubjectRegistration;
import org.jboss.identity.federation.bindings.util.HTTPRedirectUtil;
@@ -50,6 +51,7 @@
import org.jboss.identity.federation.bindings.util.ValveUtil;
import org.jboss.identity.federation.core.saml.v2.exceptions.AssertionExpiredException;
import org.jboss.identity.federation.core.saml.v2.exceptions.IssuerNotTrustedException;
+import org.jboss.identity.federation.saml.v2.assertion.EncryptedElementType;
import org.jboss.identity.federation.saml.v2.protocol.AuthnRequestType;
import org.jboss.identity.federation.saml.v2.protocol.ResponseType;
@@ -66,7 +68,7 @@
private static Logger log = Logger.getLogger(SPRedirectFormAuthenticator.class);
- protected SP spConfiguration = null;
+ protected SPType spConfiguration = null;
private String serviceURL = null;
private String identityURL = null;
@@ -210,7 +212,7 @@
try
{
String issuerDomain = ValveUtil.getDomain(issuer);
- Trust idpTrust = spConfiguration.getTrust();
+ TrustType idpTrust = spConfiguration.getTrust();
if(idpTrust != null)
{
String domainsTrusted = idpTrust.getDomains();
@@ -228,6 +230,16 @@
{
return request.getParameter("SAMLResponse") != null;
}
+
+ /**
+ * Subclasses should provide the implementation
+ * @param responseType ResponseType that contains the encrypted assertion
+ * @return response type with the decrypted assertion
+ */
+ protected ResponseType decryptAssertion(ResponseType responseType) throws Exception
+ {
+ throw new RuntimeException("This authenticator does not handle encryption");
+ }
private Principal process(Request request, Response response) throws Exception
{
@@ -248,6 +260,16 @@
this.isTrusted(responseType.getIssuer().getValue());
+ List<Object> assertions = responseType.getAssertionOrEncryptedAssertion();
+ if(assertions.size() == 0)
+ throw new IllegalStateException("No assertions in reply from IDP");
+
+ Object assertion = assertions.get(0);
+ if(assertion instanceof EncryptedElementType)
+ {
+ responseType = this.decryptAssertion(responseType);
+ }
+
SPUtil spUtil = new SPUtil();
return spUtil.handleSAMLResponse(request, responseType);
}
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPRedirectSignatureFormAuthenticator.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPRedirectSignatureFormAuthenticator.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPRedirectSignatureFormAuthenticator.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -27,19 +27,27 @@
import org.apache.catalina.LifecycleException;
import org.apache.catalina.connector.Request;
import org.apache.log4j.Logger;
-import org.jboss.identity.federation.bindings.config.KeyProvider;
+import org.jboss.identity.federation.api.saml.v2.response.SAML2Response;
+import org.jboss.identity.federation.api.util.XMLEncryptionUtil;
+import org.jboss.identity.federation.bindings.config.KeyProviderType;
import org.jboss.identity.federation.bindings.interfaces.TrustKeyManager;
import org.jboss.identity.federation.bindings.util.RedirectBindingSignatureUtil;
+import org.jboss.identity.federation.core.saml.v2.util.DocumentUtil;
import org.jboss.identity.federation.core.saml.v2.util.SignatureUtil;
+import org.jboss.identity.federation.saml.v2.assertion.EncryptedElementType;
+import org.jboss.identity.federation.saml.v2.protocol.ResponseType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
/**
- * Tomcat Authenticator for the HTTP/Redirect
- * binding with Signature support
+ * Tomcat Authenticator for the HTTP/Redirect binding with Signature support
* @author Anil.Saldhana(a)redhat.com
* @since Jan 12, 2009
*/
public class SPRedirectSignatureFormAuthenticator extends SPRedirectFormAuthenticator
{
+
+
private static Logger log = Logger.getLogger(SPRedirectSignatureFormAuthenticator.class);
private TrustKeyManager keyManager;
@@ -53,7 +61,7 @@
public void start() throws LifecycleException
{
super.start();
- KeyProvider keyProvider = this.spConfiguration.getKeyProvider();
+ KeyProviderType keyProvider = this.spConfiguration.getKeyProvider();
try
{
ClassLoader tcl = SecurityActions.getContextClassLoader();
@@ -122,4 +130,19 @@
throw new RuntimeException(e);
}
}
+
+ @Override
+ protected ResponseType decryptAssertion(ResponseType responseType) throws Exception
+ {
+ SAML2Response saml2Response = new SAML2Response();
+ PrivateKey privateKey = keyManager.getSigningKey();
+
+ EncryptedElementType myEET = (EncryptedElementType) responseType.getAssertionOrEncryptedAssertion().get(0);
+ Document eetDoc = saml2Response.convert(myEET);
+
+ Element decryptedDocumentElement = XMLEncryptionUtil.decryptElementInDocument(eetDoc,privateKey);
+
+ //Let us use the encrypted doc element to decrypt it
+ return saml2Response.getResponseType(DocumentUtil.getNodeAsStream(decryptedDocumentElement));
+ }
}
\ No newline at end of file
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPUtil.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPUtil.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/sp/SPUtil.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -94,7 +94,11 @@
if(JBossSAMLURIConstants.STATUS_SUCCESS.get().equals(statusValue) == false)
throw new SecurityException("IDP forbid the user");
- AssertionType assertion = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);
+ List<Object> assertions = responseType.getAssertionOrEncryptedAssertion();
+ if(assertions.size() == 0)
+ throw new IllegalStateException("No assertions in reply from IDP");
+
+ AssertionType assertion = (AssertionType)assertions.get(0);
//Check for validity of assertion
ConditionsType conditionsType = assertion.getConditions();
if(conditionsType != null)
@@ -123,6 +127,7 @@
return this.createGenericPrincipal(request, userName, roles);
}
+
private Principal createGenericPrincipal(Request request, String username, List<String> roles)
{
Context ctx = request.getContext();
Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/ValveUtil.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/ValveUtil.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/ValveUtil.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -29,8 +29,8 @@
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Unmarshaller;
-import org.jboss.identity.federation.bindings.config.IDP;
-import org.jboss.identity.federation.bindings.config.SP;
+import org.jboss.identity.federation.bindings.config.IDPType;
+import org.jboss.identity.federation.bindings.config.SPType;
import org.jboss.identity.federation.core.saml.v2.factories.JBossSAMLBaseFactory;
/**
@@ -73,26 +73,26 @@
}
@SuppressWarnings("unchecked")
- public static IDP getIDPConfiguration(InputStream is) throws Exception
+ public static IDPType getIDPConfiguration(InputStream is) throws Exception
{
if(is == null)
throw new IllegalArgumentException("inputstream is null");
String schema = "schema/config/jboss-identity-fed.xsd";
Unmarshaller un = JBossSAMLBaseFactory.getValidatingUnmarshaller("org.jboss.identity.federation.bindings.config", schema);
- JAXBElement<IDP> jaxbSp = (JAXBElement<IDP>) un.unmarshal(is);
+ JAXBElement<IDPType> jaxbSp = (JAXBElement<IDPType>) un.unmarshal(is);
return jaxbSp.getValue();
}
@SuppressWarnings("unchecked")
- public static SP getSPConfiguration(InputStream is) throws Exception
+ public static SPType getSPConfiguration(InputStream is) throws Exception
{
if(is == null)
throw new IllegalArgumentException("inputstream is null");
String schema = "schema/config/jboss-identity-fed.xsd";
Unmarshaller un = JBossSAMLBaseFactory.getValidatingUnmarshaller("org.jboss.identity.federation.bindings.config", schema);
- JAXBElement<SP> jaxbSp = (JAXBElement<SP>) un.unmarshal(is);
+ JAXBElement<SPType> jaxbSp = (JAXBElement<SPType>) un.unmarshal(is);
return jaxbSp.getValue();
}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/cert/EncryptionKeyUtil.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/cert/EncryptionKeyUtil.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/util/cert/EncryptionKeyUtil.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.bindings.util.cert;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+
+/**
+ * Utility to generate symmetric key
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 4, 2009
+ */
+public class EncryptionKeyUtil
+{
+ /**
+ * Generate a secret key useful for encryption/decryption
+ * @param encAlgo
+ * @param keySize Length of the key (if 0, defaults to 128 bits)
+ * @return
+ * @throws Exception
+ */
+ public static SecretKey getSecretKey(String encAlgo, int keySize) throws Exception
+ {
+ KeyGenerator keyGenerator = KeyGenerator.getInstance(encAlgo);
+ if(keySize == 0)
+ keySize = 128;
+ keyGenerator.init(keySize);
+ return keyGenerator.generateKey();
+ }
+
+}
\ No newline at end of file
Modified: identity-federation/trunk/identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd 2009-02-09 03:43:49 UTC (rev 308)
@@ -2,7 +2,7 @@
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:jboss:identity-federation:config:1.0"
xmlns:tns="urn:jboss:identity-federation:config:1.0"
elementFormDefault="qualified" version="1.0">
- <complexType name="IDP">
+ <complexType name="IDPType">
<annotation>
<documentation>
IDP Type defines the configuration for an Identity
@@ -10,21 +10,34 @@
</documentation>
</annotation>
<complexContent>
- <extension base="tns:Provider">
- <attribute name="AssertionValidity" type="long" use="optional" default="5000"></attribute>
- <attribute name="RoleGenerator" type="string" use="optional" default="org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator"></attribute>
+ <extension base="tns:ProviderType">
+ <sequence>
+ <element name="Encryption" type="tns:EncryptionType"
+ maxOccurs="1" minOccurs="0">
+ </element>
+ </sequence>
+ <attribute name="AssertionValidity" type="long"
+ use="optional" default="300000"> <!-- 5 minutes expressed in miliseconds -->
+ </attribute>
+ <attribute name="RoleGenerator" type="string"
+ use="optional"
+ default="org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator">
+ </attribute>
+ <attribute name="Encrypt" type="boolean" use="optional"
+ default="false">
+ </attribute>
</extension>
</complexContent>
</complexType>
- <element name="JBossIDP" type="tns:IDP">
+ <element name="JBossIDP" type="tns:IDPType">
<annotation>
<documentation>The root configuration for an Identity Provider(IDP) using JBoss Identity.</documentation>
</annotation>
</element>
- <complexType name="Trust">
+ <complexType name="TrustType">
<annotation>
<documentation>Aspects involved in trust decisions such as the domains that the IDP or the Service Provider trusts.</documentation>
</annotation>
@@ -37,14 +50,14 @@
</sequence>
</complexType>
- <complexType name="KeyProvider">
+ <complexType name="KeyProviderType">
<annotation>
<documentation>
Source of the Signing and Validating Key
</documentation>
</annotation>
<sequence>
- <element name="Auth" type="tns:AuthProperty"
+ <element name="Auth" type="tns:AuthPropertyType"
maxOccurs="unbounded" minOccurs="0">
<annotation>
<documentation>
@@ -53,7 +66,7 @@
</documentation>
</annotation>
</element>
- <element name="ValidatingAlias" type="tns:KeyValue"
+ <element name="ValidatingAlias" type="tns:KeyValueType"
maxOccurs="unbounded" minOccurs="0">
<annotation>
<documentation>
@@ -74,12 +87,12 @@
<attribute name="ClassName" type="string"></attribute>
</complexType>
- <complexType name="KeyValue">
+ <complexType name="KeyValueType">
<attribute name="Key" type="string"></attribute>
<attribute name="Value" type="string"></attribute>
</complexType>
- <complexType name="Provider">
+ <complexType name="ProviderType">
<annotation>
<documentation>Base Type for IDP and SP</documentation>
</annotation>
@@ -87,21 +100,21 @@
<element name="IdentityURL" type="string" maxOccurs="1"
minOccurs="1">
</element>
- <element name="Trust" type="tns:Trust" maxOccurs="1"
+ <element name="Trust" type="tns:TrustType" maxOccurs="1"
minOccurs="0">
</element>
- <element name="KeyProvider" type="tns:KeyProvider"
+ <element name="KeyProvider" type="tns:KeyProviderType"
maxOccurs="1" minOccurs="0">
</element>
</sequence>
</complexType>
- <complexType name="SP">
+ <complexType name="SPType">
<annotation>
<documentation>Service Provider Type</documentation>
</annotation>
<complexContent>
- <extension base="tns:Provider">
+ <extension base="tns:ProviderType">
<sequence>
<element name="ServiceURL" type="string"></element>
</sequence>
@@ -109,11 +122,26 @@
</complexContent>
</complexType>
- <complexType name="AuthProperty">
+ <complexType name="AuthPropertyType">
<complexContent>
- <extension base="tns:KeyValue"></extension>
+ <extension base="tns:KeyValueType"></extension>
</complexContent>
</complexType>
- <element name="JBossSP" type="tns:SP"></element>
+ <element name="JBossSP" type="tns:SPType"></element>
+
+ <simpleType name="EncAlgoType">
+ <restriction base="string">
+ <enumeration value="AES"></enumeration>
+ <enumeration value="DES"></enumeration>
+ <enumeration value="DESede"></enumeration>
+ </restriction>
+ </simpleType>
+
+ <complexType name="EncryptionType">
+ <sequence>
+ <element name="EncAlgo" type="tns:EncAlgoType"></element>
+ <element name="KeySize" type="int"></element>
+ </sequence>
+ </complexType>
</schema>
\ No newline at end of file
Modified: identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/ConfigUnitTestCase.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/ConfigUnitTestCase.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/ConfigUnitTestCase.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -29,12 +29,12 @@
import junit.framework.TestCase;
-import org.jboss.identity.federation.bindings.config.AuthProperty;
-import org.jboss.identity.federation.bindings.config.IDP;
-import org.jboss.identity.federation.bindings.config.KeyProvider;
-import org.jboss.identity.federation.bindings.config.KeyValue;
-import org.jboss.identity.federation.bindings.config.SP;
-import org.jboss.identity.federation.bindings.config.Trust;
+import org.jboss.identity.federation.bindings.config.AuthPropertyType;
+import org.jboss.identity.federation.bindings.config.IDPType;
+import org.jboss.identity.federation.bindings.config.KeyProviderType;
+import org.jboss.identity.federation.bindings.config.KeyValueType;
+import org.jboss.identity.federation.bindings.config.SPType;
+import org.jboss.identity.federation.bindings.config.TrustType;
import org.jboss.identity.federation.core.saml.v2.factories.JBossSAMLBaseFactory;
/**
@@ -48,11 +48,11 @@
public void test01() throws Exception
{
- IDP idp = this.getIDP(config + "1.xml");
- assertEquals("5000",5000L,idp.getAssertionValidity());
+ IDPType idp = this.getIDP(config + "1.xml");
+ assertEquals("300000",300000L,idp.getAssertionValidity());
assertEquals("org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator",idp.getRoleGenerator());
- Trust trust = idp.getTrust();
+ TrustType trust = idp.getTrust();
assertNotNull("Trust is not null", trust);
String domains = trust.getDomains();
assertTrue("localhost trusted", domains.indexOf("localhost") > -1);
@@ -61,15 +61,16 @@
public void test02() throws Exception
{
- IDP idp = this.getIDP(config + "2.xml");
+ IDPType idp = this.getIDP(config + "2.xml");
assertEquals("20000",20000L,idp.getAssertionValidity());
assertEquals("somefqn",idp.getRoleGenerator());
- KeyProvider kp = idp.getKeyProvider();
+ assertTrue(idp.isEncrypt());
+ KeyProviderType kp = idp.getKeyProvider();
assertNotNull("KeyProvider is not null", kp);
assertEquals("SomeClass", "SomeClass", kp.getClassName());
- List<AuthProperty> authProps = kp.getAuth();
- AuthProperty authProp = authProps.get(0);
+ List<AuthPropertyType> authProps = kp.getAuth();
+ AuthPropertyType authProp = authProps.get(0);
assertEquals("SomeKey", "SomeKey", authProp.getKey());
assertEquals("SomeValue", "SomeValue", authProp.getValue());
@@ -77,10 +78,10 @@
assertEquals("DBURL", "DBURL", authProp.getKey());
assertEquals("SomeDBURL", "SomeDBURL", authProp.getValue());
- List<KeyValue> validatingAliases = kp.getValidatingAlias();
+ List<KeyValueType> validatingAliases = kp.getValidatingAlias();
assertEquals("Validating Alias length is 2", 2, validatingAliases.size());
- KeyValue kv = validatingAliases.get(0);
+ KeyValueType kv = validatingAliases.get(0);
assertEquals("localhost", kv.getKey());
assertEquals("localhostalias", kv.getValue());
@@ -88,7 +89,7 @@
assertEquals("jboss.com", kv.getKey());
assertEquals("jbossalias", kv.getValue());
- Trust trust = idp.getTrust();
+ TrustType trust = idp.getTrust();
assertNotNull("Trust is not null", trust);
String domains = trust.getDomains();
assertTrue("localhost trusted", domains.indexOf("localhost") > -1);
@@ -97,13 +98,13 @@
public void test03() throws Exception
{
- SP sp = getSP(config + "3.xml");
+ SPType sp = getSP(config + "3.xml");
assertEquals("http://localhost:8080/idp", sp.getIdentityURL());
assertEquals("http://localhost:8080/sales", sp.getServiceURL());
}
@SuppressWarnings("unchecked")
- private SP getSP(String configFile) throws Exception
+ private SPType getSP(String configFile) throws Exception
{
String schema = "schema/config/jboss-identity-fed.xsd";
@@ -112,12 +113,12 @@
assertNotNull("Inputstream not null", is);
Unmarshaller un = JBossSAMLBaseFactory.getValidatingUnmarshaller("org.jboss.identity.federation.bindings.config", schema);
- JAXBElement<SP> jaxbSp = (JAXBElement<SP>) un.unmarshal(is);
+ JAXBElement<SPType> jaxbSp = (JAXBElement<SPType>) un.unmarshal(is);
assertNotNull("SP is not null", jaxbSp);
return jaxbSp.getValue();
}
@SuppressWarnings("unchecked")
- private IDP getIDP(String configFile) throws Exception
+ private IDPType getIDP(String configFile) throws Exception
{
String schema = "schema/config/jboss-identity-fed.xsd";
@@ -126,7 +127,7 @@
assertNotNull("Inputstream not null", is);
Unmarshaller un = JBossSAMLBaseFactory.getValidatingUnmarshaller("org.jboss.identity.federation.bindings.config", schema);
- JAXBElement<IDP> jaxbIdp = (JAXBElement<IDP>) un.unmarshal(is);
+ JAXBElement<IDPType> jaxbIdp = (JAXBElement<IDPType>) un.unmarshal(is);
assertNotNull("IDP is not null", jaxbIdp);
return jaxbIdp.getValue();
}
Modified: identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-2.xml
===================================================================
--- identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-2.xml 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-2.xml 2009-02-09 03:43:49 UTC (rev 308)
@@ -1,6 +1,7 @@
<JBossIDP xmlns="urn:jboss:identity-federation:config:1.0"
AssertionValidity="20000"
- RoleGenerator="somefqn">
+ RoleGenerator="somefqn"
+ Encrypt="true">
<IdentityURL>http://localhost:8080/idp</IdentityURL>
<Trust>
<Domains>localhost,jboss.com,jboss.org</Domains>
Modified: identity-federation/trunk/identity-fed-core/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-core/.classpath 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-fed-core/.classpath 2009-02-09 03:43:49 UTC (rev 308)
@@ -10,5 +10,6 @@
<classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.9/jaxb-api-2.1.9.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jboss/security/jboss-xacml/2.0.3-SNAPSHOT/jboss-xacml-2.0.3-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0/stax-api-1.0.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity-xmlsecmodel"/>
<classpathentry kind="output" path="target-eclipse"/>
</classpath>
Added: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossEncryptionConstants.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossEncryptionConstants.java (rev 0)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossEncryptionConstants.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.core.saml.v2.constants;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Encryption Algorithm and XMLEnC URI
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 4, 2009
+ */
+public class JBossEncryptionConstants
+{
+ private static Map<String,String> algoToXmlEncURL = new HashMap<String,String>();
+
+ static
+ {
+ algoToXmlEncURL.put("DESede", "http://www.w3.org/2001/04/xmlenc#kw-tripledes");
+ algoToXmlEncURL.put("TRIPLEDES", "http://www.w3.org/2001/04/xmlenc#kw-tripledes");
+
+ algoToXmlEncURL.put("AES_128", "http://www.w3.org/2001/04/xmlenc#aes128-cbc");
+ algoToXmlEncURL.put("AES_192", "http://www.w3.org/2001/04/xmlenc#aes192-cbc");
+ algoToXmlEncURL.put("AES_256", "http://www.w3.org/2001/04/xmlenc#aes256-cbc");
+ }
+
+ public static String getURL(String algo, int keySize)
+ {
+ if(keySize == 0)
+ return algoToXmlEncURL.get(algo);
+ return algoToXmlEncURL.get(algo+ "_" +keySize);
+ }
+}
Modified: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossSAMLURIConstants.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossSAMLURIConstants.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossSAMLURIConstants.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -30,9 +30,11 @@
public enum JBossSAMLURIConstants
{
AC_PASSWORD_PROTECTED_TRANSPORT("urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"),
+ ASSERTION_NSURI("urn:oasis:names:tc:SAML:2.0:assertion"),
ATTRIBUTE_FORMAT_BASIC("urn:oasis:names:tc:SAML:2.0:attrname-format:basic"),
NAMEID_FORMAT_TRANSIENT("urn:oasis:names:tc:SAML:2.0:nameid-format:transient"),
NAMEID_FORMAT_PERSISTENT("urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"),
+ PROTOCOL_NSURI("urn:oasis:names:tc:SAML:2.0:protocol"),
SIGNATURE_DSA_SHA1("http://www.w3.org/2000/09/xmldsig#dsa-sha1"),
SIGNATURE_RSA_SHA1("http://www.w3.org/2000/09/xmldsig#rsa-sha1"),
SUBJECT_CONFIRMATION_BEARER("urn:oasis:names:tc:SAML:2.0:cm:bearer"),
@@ -42,7 +44,10 @@
STATUS_SUCCESS("urn:oasis:names:tc:SAML:2.0:status:Success"),
STATUS_VERSION_MISMATCH("urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"),
TRANSFORM_ENVELOPED_SIGNATURE("http://www.w3.org/2000/09/xmldsig#enveloped-signature"),
- TRANSFORM_C14N_EXCL_OMIT_COMMENTS("http://www.w3.org/2001/10/xml-exc-c14n#WithComments");
+ TRANSFORM_C14N_EXCL_OMIT_COMMENTS("http://www.w3.org/2001/10/xml-exc-c14n#WithComments"),
+ XMLSCHEMA_NSURI("http://www.w3.org/2001/XMLSchema"),
+ XMLDSIG_NSURI("http://www.w3.org/2000/09/xmldsig#"),
+ XMLENC_NSURI("http://www.w3.org/2001/04/xmlenc#");
private String uri = null;
Modified: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/JBossSAMLAuthnResponseFactory.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -46,7 +46,7 @@
*/
public class JBossSAMLAuthnResponseFactory
{
- private static String pkgName = "org.jboss.identity.federation.saml.v2.protocol:org.jboss.identity.xmlsec.w3.xmldsig";
+ private static String pkgName = "org.jboss.identity.federation.saml.v2.protocol:org.jboss.identity.xmlsec.w3.xmldsig:org.jboss.identity.xmlsec.w3.xmlenc";
private static String schemaLocation = "schema/saml/v2/saml-schema-protocol-2.0.xsd";
/**
@@ -74,38 +74,11 @@
* @throws Exception
*/
public static ResponseType createResponseType(String ID, SPInfoHolder sp, IDPInfoHolder idp, IssuerInfoHolder issuerInfo) throws Exception
- {
- /*ResponseType responseType = protocolObjectFactory.createResponseType();
- responseType.setVersion(issuerInfo.getSamlVersion());
-
- //ID
- responseType.setID(ID);
- //InResponseTo ID
- responseType.setInResponseTo(sp.getRequestID());
- //Destination
+ {
String responseDestinationURI = sp.getResponseDestinationURI();
- responseType.setDestination(responseDestinationURI);
- //Issuer
- NameIDType issuer = issuerInfo.getIssuer();
- responseType.setIssuer(issuer);
-
- //Status
- String statusCode = issuerInfo.getStatusCode();
- if(statusCode == null)
- throw new IllegalArgumentException("issuerInfo missing status code");
-
- responseType.setStatus(createStatusType(statusCode) );
-
XMLGregorianCalendar issueInstant = XMLTimeUtil.getIssueInstant();
- //IssueInstant
- responseType.setIssueInstant(issueInstant);*/
-
- String responseDestinationURI = sp.getResponseDestinationURI();
-
- XMLGregorianCalendar issueInstant = XMLTimeUtil.getIssueInstant();
-
//Create an assertion
AssertionType assertionType = JBossSAMLBaseFactory.createAssertion();
assertionType.setID("ID_" + JBossSAMLBaseFactory.createUUID());
@@ -172,8 +145,8 @@
//IssueInstant
responseType.setIssueInstant(issueInstant);
-
- responseType.getAssertionOrEncryptedAssertion().add(assertionType);
+
+ responseType.getAssertionOrEncryptedAssertion().add(assertionType);
return responseType;
}
Modified: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/SAMLProtocolFactory.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/SAMLProtocolFactory.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/factories/SAMLProtocolFactory.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -32,9 +32,9 @@
public class SAMLProtocolFactory
{
private static ObjectFactory factory = new ObjectFactory();
-
+
public static ObjectFactory getObjectFactory()
{
return factory;
- }
+ }
}
\ No newline at end of file
Modified: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/DocumentUtil.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/DocumentUtil.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/DocumentUtil.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -24,8 +24,13 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
import java.io.StringWriter;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
@@ -34,6 +39,9 @@
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
/**
* Utility dealing with DOM
@@ -42,31 +50,99 @@
*/
public class DocumentUtil
{
+ /**
+ * Create a new document
+ * @return
+ * @throws Exception
+ */
+ public static Document createDocument() throws Exception
+ {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ return builder.newDocument();
+ }
+
+ /**
+ * Parse a document from the string
+ * @param docString
+ * @return
+ * @throws Exception
+ */
+ public static Document getDocument(String docString) throws Exception
+ {
+ return getDocument(new StringReader(docString));
+ }
+
+ /**
+ * Parse a document from a reader
+ * @param reader
+ * @return
+ * @throws Exception
+ */
+ public static Document getDocument(Reader reader) throws Exception
+ {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ return builder.parse(new InputSource(reader));
+ }
+
+ /**
+ * Marshall a document into a String
+ * @param signedDoc
+ * @return
+ * @throws Exception
+ */
public static String getDocumentAsString(Document signedDoc) throws Exception
{
Source source = new DOMSource(signedDoc);
StringWriter sw = new StringWriter();
Result streamResult = new StreamResult(sw);
- // Write the DOM document to the file
+ // Write the DOM document to the stream
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(source, streamResult);
return sw.toString();
}
-
- public static InputStream getDocumentAsStream(Document signedDoc) throws Exception
+
+ /**
+ * Marshall a DOM Element as string
+ * @param element
+ * @return
+ * @throws Exception
+ */
+ public static String getDOMElementAsString(Element element) throws Exception
{
- Source source = new DOMSource(signedDoc);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- Result streamResult = new StreamResult(baos);
+ Source source = new DOMSource(element);
+ StringWriter sw = new StringWriter();
+
+ Result streamResult = new StreamResult(sw);
// Write the DOM document to the file
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(source, streamResult);
- ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
-
- return bis;
- }
+ return sw.toString();
+ }
+
+ /**
+ * Stream a DOM Node as an input stream
+ * @param node
+ * @return
+ * @throws Exception
+ */
+ public static InputStream getNodeAsStream(Node node) throws Exception
+ {
+ Source source = new DOMSource(node);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ Result streamResult = new StreamResult(baos);
+ // Write the DOM document to the stream
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.transform(source, streamResult);
+
+ ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
+
+ return bis;
+ }
}
\ No newline at end of file
Modified: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/JAXBElementMappingUtil.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/JAXBElementMappingUtil.java 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/JAXBElementMappingUtil.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -23,10 +23,12 @@
import javax.xml.bind.JAXBElement;
+import org.jboss.identity.federation.core.saml.v2.factories.SAMLAssertionFactory;
import org.jboss.identity.federation.core.saml.v2.factories.SAMLProtocolFactory;
import org.jboss.identity.federation.core.saml.v2.factories.SOAPFactory;
import org.jboss.identity.federation.core.saml.v2.factories.XACMLStatementFactory;
import org.jboss.identity.federation.org.xmlsoap.schemas.soap.envelope.Envelope;
+import org.jboss.identity.federation.saml.v2.assertion.EncryptedElementType;
import org.jboss.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType;
import org.jboss.identity.federation.saml.v2.protocol.ArtifactResolveType;
import org.jboss.identity.federation.saml.v2.protocol.AssertionIDRequestType;
@@ -85,16 +87,41 @@
throw new IllegalArgumentException("Unknown Type:"+requestAbstractType);
}
+ /**
+ * Get the JAXBElement for an encrypted assertion
+ * @param encryptedAssertion
+ * @return
+ */
+ public static JAXBElement<?> get(EncryptedElementType encryptedAssertion)
+ {
+ return SAMLAssertionFactory.getObjectFactory().createEncryptedAssertion(encryptedAssertion);
+ }
+
+ /**
+ * Get the JAXBElement for response
+ * @param responseType
+ * @return
+ */
public static JAXBElement<?> get(ResponseType responseType)
{
return SAMLProtocolFactory.getObjectFactory().createResponse(responseType);
}
+ /**
+ * Get the JAXBElement for a SOAP envelope
+ * @param envelope
+ * @return
+ */
public static JAXBElement<?> get(Envelope envelope)
{
return SOAPFactory.getObjectFactory().createEnvelope(envelope);
}
+ /**
+ * Get the JAXBElement for an XACML authorization statement
+ * @param xacmlStatement
+ * @return
+ */
public static JAXBElement<?> get(XACMLAuthzDecisionStatementType xacmlStatement)
{
return XACMLStatementFactory.getObjectFactory().createXACMLAuthzDecisionStatement(xacmlStatement);
Added: identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/xmlenc/factories/XMLEncryptionFactory.java
===================================================================
--- identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/xmlenc/factories/XMLEncryptionFactory.java (rev 0)
+++ identity-federation/trunk/identity-fed-core/src/main/java/org/jboss/identity/federation/core/xmlenc/factories/XMLEncryptionFactory.java 2009-02-09 03:43:49 UTC (rev 308)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.core.xmlenc.factories;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Marshaller;
+
+import org.jboss.identity.xmlsec.w3.xmlenc.ObjectFactory;
+
+
+/**
+ * Get the XML Encryption Model Object Factory
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 5, 2009
+ */
+public class XMLEncryptionFactory
+{
+ private static ObjectFactory factory = new ObjectFactory();
+
+ public static ObjectFactory getObjectFactory()
+ {
+ return factory;
+ }
+
+ public static Marshaller getMarshaller() throws Exception
+ {
+ JAXBContext jc = JAXBContext.newInstance("org.jboss.identity.xmlsec.w3.xmlenc");
+ Marshaller marshaller = jc.createMarshaller();
+ marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ return marshaller;
+ }
+}
\ No newline at end of file
Modified: identity-federation/trunk/pom.xml
===================================================================
--- identity-federation/trunk/pom.xml 2009-02-09 03:41:50 UTC (rev 307)
+++ identity-federation/trunk/pom.xml 2009-02-09 03:43:49 UTC (rev 308)
@@ -20,7 +20,7 @@
<module>identity-fed-core</module>
<module>identity-fed-api</module>
<module>identity-bindings</module>
- <module>doc</module>
<module>assembly</module>
</modules>
+
</project>
15 years, 2 months
JBoss Identity SVN: r307 - in identity-federation/trunk/identity-fed-api: src/main/java/org/jboss/identity/federation/api/saml/v2/response and 8 other directories.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-08 22:41:50 -0500 (Sun, 08 Feb 2009)
New Revision: 307
Added:
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/DocumentUtilUnitTestCase.java
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/XMLEncryptionUnitTestCase.java
identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/
identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/resolver.jar
identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/serializer.jar
identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xalan.jar
identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xercesImpl.jar
identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xml-apis.jar
identity-federation/trunk/identity-fed-api/src/test/resources/xml/
identity-federation/trunk/identity-fed-api/src/test/resources/xml/dom/
identity-federation/trunk/identity-fed-api/src/test/resources/xml/dom/enc-sample.xml
Removed:
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/XMLEncryptionUnitTestCase.java
Modified:
identity-federation/trunk/identity-fed-api/.classpath
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/response/SAML2Response.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java
Log:
JBID-47: xml enc support
Modified: identity-federation/trunk/identity-fed-api/.classpath
===================================================================
--- identity-federation/trunk/identity-fed-api/.classpath 2009-02-04 23:04:06 UTC (rev 306)
+++ identity-federation/trunk/identity-fed-api/.classpath 2009-02-09 03:41:50 UTC (rev 307)
@@ -7,7 +7,7 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.4/junit-4.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9.jar" sourcepath="/M2_REPO/sun-jaxb/jaxb-impl/2.1.9/jaxb-impl-2.1.9-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/identity-fed-core"/>
Modified: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/response/SAML2Response.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/response/SAML2Response.java 2009-02-04 23:04:06 UTC (rev 306)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/response/SAML2Response.java 2009-02-09 03:41:50 UTC (rev 307)
@@ -26,6 +26,8 @@
import java.io.Writer;
import java.util.List;
+import javax.xml.bind.Binder;
+import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
@@ -37,12 +39,17 @@
import org.jboss.identity.federation.core.saml.v2.holders.IDPInfoHolder;
import org.jboss.identity.federation.core.saml.v2.holders.IssuerInfoHolder;
import org.jboss.identity.federation.core.saml.v2.holders.SPInfoHolder;
+import org.jboss.identity.federation.core.saml.v2.util.DocumentUtil;
+import org.jboss.identity.federation.core.saml.v2.util.JAXBElementMappingUtil;
import org.jboss.identity.federation.core.saml.v2.util.XMLTimeUtil;
import org.jboss.identity.federation.saml.v2.assertion.AssertionType;
import org.jboss.identity.federation.saml.v2.assertion.AttributeStatementType;
import org.jboss.identity.federation.saml.v2.assertion.AttributeType;
import org.jboss.identity.federation.saml.v2.assertion.ConditionsType;
+import org.jboss.identity.federation.saml.v2.assertion.EncryptedElementType;
import org.jboss.identity.federation.saml.v2.protocol.ResponseType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
/**
* API for dealing with SAML2 Response objects
@@ -95,6 +102,8 @@
public void createTimedConditions(AssertionType assertion, long durationInMilis) throws Exception
{
XMLGregorianCalendar issueInstant = assertion.getIssueInstant();
+ if(issueInstant == null)
+ throw new IllegalStateException("assertion does not have issue instant");
XMLGregorianCalendar assertionValidityLength = XMLTimeUtil.add(issueInstant, durationInMilis);
ConditionsType conditionsType = JBossSAMLBaseFactory.getObjectFactory().createConditionsType();
conditionsType.setNotBefore(issueInstant);
@@ -104,6 +113,34 @@
}
/**
+ * Get an encrypted assertion from the stream
+ * @param is
+ * @return
+ * @throws Exception
+ */
+ @SuppressWarnings("unchecked")
+ public EncryptedElementType getEncryptedAssertion(InputStream is) throws Exception
+ {
+ if(is == null)
+ throw new IllegalArgumentException("inputstream is null");
+
+ Unmarshaller un = JBossSAMLAuthnResponseFactory.getValidatingUnmarshaller();
+ JAXBElement<EncryptedElementType> jaxb = (JAXBElement<EncryptedElementType>) un.unmarshal(is);
+ return jaxb.getValue();
+ }
+
+ @SuppressWarnings("unchecked")
+ public AssertionType getAssertionType(InputStream is) throws Exception
+ {
+ if(is == null)
+ throw new IllegalArgumentException("inputstream is null");
+
+ Unmarshaller un = JBossSAMLAuthnResponseFactory.getValidatingUnmarshaller();
+ JAXBElement<AssertionType> jaxb = (JAXBElement<AssertionType>) un.unmarshal(is);
+ return jaxb.getValue();
+ }
+
+ /**
* Read a ResponseType from an input stream
* @param is
* @return
@@ -120,6 +157,26 @@
return jaxbAuthnRequestType.getValue();
}
+ public Document convert(EncryptedElementType encryptedElementType) throws Exception
+ {
+ JAXBContext jaxb = JAXBContext.newInstance(EncryptedElementType.class);
+ Binder<Node> binder = jaxb.createBinder();
+
+ Document doc = DocumentUtil.createDocument();
+ binder.marshal(JAXBElementMappingUtil.get(encryptedElementType), doc);
+ return doc;
+ }
+
+ public Document convert(ResponseType responseType) throws Exception
+ {
+ JAXBContext jaxb = JAXBContext.newInstance(ResponseType.class);
+ Binder<Node> binder = jaxb.createBinder();
+
+ Document doc = DocumentUtil.createDocument();
+ binder.marshal(JAXBElementMappingUtil.get(responseType), doc);
+ return doc;
+ }
+
/**
* Marshall the response type to the output stream
* <p> <b>Note:</b> JAXB marshaller by default picks up arbitrary namespace
Modified: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java 2009-02-04 23:04:06 UTC (rev 306)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java 2009-02-09 03:41:50 UTC (rev 307)
@@ -23,16 +23,18 @@
import java.security.Key;
import java.security.PrivateKey;
+import java.security.PublicKey;
import javax.crypto.SecretKey;
+import javax.xml.namespace.QName;
import org.apache.xml.security.encryption.EncryptedData;
import org.apache.xml.security.encryption.EncryptedKey;
import org.apache.xml.security.encryption.XMLCipher;
-import org.apache.xml.security.keys.KeyInfo;
-import org.apache.xml.security.utils.EncryptionConstants;
+import org.jboss.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
@@ -46,51 +48,12 @@
*/
public class XMLEncryptionUtil
{
- public static final String TRIPLEDES = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc";
+ private static String XMLSIG_NS = JBossSAMLURIConstants.XMLDSIG_NSURI.get();
+ private static String XMLENC_NS = JBossSAMLURIConstants.XMLENC_NSURI.get();
- public static final String AES_128 = "http://www.w3.org/2001/04/xmlenc#aes128-cbc";
-
- public static final String AES_256 = "http://www.w3.org/2001/04/xmlenc#aes256-cbc";
-
- public static final String AES_192 = "http://www.w3.org/2001/04/xmlenc#aes192-cbc";
-
- public static final String RSA_v1dot5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5";
-
- public static final String RSA_OAEP = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
-
- public static final String DIFFIE_HELLMAN = "http://www.w3.org/2001/04/xmlenc#dh";
-
- public static final String TRIPLEDES_KeyWrap = "http://www.w3.org/2001/04/xmlenc#kw-tripledes";
-
- public static final String AES_128_KeyWrap = "http://www.w3.org/2001/04/xmlenc#kw-aes128";
-
- public static final String AES_256_KeyWrap = "http://www.w3.org/2001/04/xmlenc#kw-aes256";
-
- public static final String AES_192_KeyWrap = "http://www.w3.org/2001/04/xmlenc#kw-aes192";
-
- public static final String SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1";
-
- public static final String SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256";
-
- public static final String SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512";
-
- public static final String RIPEMD_160 = "http://www.w3.org/2001/04/xmlenc#ripemd160";
-
- public static final String XML_DSIG = "http://www.w3.org/2000/09/xmldsig#";
-
- public static final String N14C_XML = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
-
- public static final String N14C_XML_WITH_COMMENTS = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";
-
- public static final String EXCL_XML_N14C = "http://www.w3.org/2001/10/xml-exc-c14n#";
-
- public static final String EXCL_XML_N14C_WITH_COMMENTS = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments";
-
- public static final String BASE64_ENCODING = "http://www.w3.org/2000/09/xmldsig#base64";
-
static
{
- //Initialize the XML Security Library
+ //Initialize the Apache XML Security Library
org.apache.xml.security.Init.init();
}
@@ -107,97 +70,215 @@
* </p>
* @param document
* @param keyToBeEncrypted Symmetric Key (SecretKey)
- * @param keyUsedToEncrypt Asymmetric Key (Public Key)
+ * @param keyUsedToEncryptSecretKey Asymmetric Key (Public Key)
+ * @param keySize Length of the key
* @return
* @throws Exception
*/
public static EncryptedKey encryptKey(Document document,
- Key keyToBeEncrypted, Key keyUsedToEncrypt) throws Exception
+ SecretKey keyToBeEncrypted, PublicKey keyUsedToEncryptSecretKey,
+ int keySize) throws Exception
{
XMLCipher keyCipher = null;
- String keyAlgo = keyUsedToEncrypt.getAlgorithm();
- if("RSA".equals(keyAlgo))
- keyCipher = XMLCipher.getInstance(XMLEncryptionUtil.RSA_v1dot5);
- else
- keyCipher = XMLCipher.getInstance(XMLEncryptionUtil.TRIPLEDES_KeyWrap);
+ String pubKeyAlg = keyUsedToEncryptSecretKey.getAlgorithm();
+
+ String keyWrapAlgo = getXMLEncryptionURLForKeyUnwrap(pubKeyAlg, keySize);
+ keyCipher = XMLCipher.getInstance(keyWrapAlgo);
- keyCipher.init(XMLCipher.WRAP_MODE, keyUsedToEncrypt);
+ keyCipher.init(XMLCipher.WRAP_MODE, keyUsedToEncryptSecretKey);
return keyCipher.encryptKey(document, keyToBeEncrypted);
}
-
+
/**
- * Encrypt either the entire document or an element within provided by the tag
- * @param document The Document to encrypt
- * @param elementTag An element in the document that you want encrypted (or null indicating entire document)
- * @param encryptingKey
- * @param algo
- * @return document that is encrypted or contains the encrypted element
+ * Encrypt an element inside a Document.
+ * @param document Document that contains an element to encrypt
+ * @param publicKey The Public Key used to encrypt the secret encryption key
+ * @param secretKey The secret encryption key
+ * @param keySize Length of key
+ * @param wrappingElementQName QName of the element to be used to wrap around
+ * the cipher data.
+ * @param addEncryptedKeyInKeyInfo Should the encrypted key be inside a KeyInfo
+ * or added as a peer of Cipher Data
+ * @return An element that has the wrappingElementQName
* @throws Exception
*/
- public static Document encrypt(Document document, String elementTag,
- SecretKey encryptingKey, Key publicKey, String algo) throws Exception
+ public static Element encryptElementInDocument(Document document, PublicKey publicKey,
+ SecretKey secretKey, int keySize, QName wrappingElementQName,
+ boolean addEncryptedKeyInKeyInfo) throws Exception
{
- XMLCipher xmlCipher = XMLCipher.getInstance(algo);
- if(xmlCipher == null)
- throw new IllegalStateException("Cipher is null for algorithm:" + algo);
- xmlCipher.init(XMLCipher.ENCRYPT_MODE, encryptingKey);
+ XMLCipher cipher = null;
+ EncryptedKey encryptedKey = encryptKey(document, secretKey, publicKey, keySize);
+
+ String encryptionAlgorithm = getXMLEncryptionURL(secretKey.getAlgorithm(), keySize);
+ //Encrypt the Document
+ cipher = XMLCipher.getInstance(encryptionAlgorithm);
+ cipher.init(XMLCipher.ENCRYPT_MODE, secretKey);
- if(elementTag != null)
+ Document encryptedDoc = cipher.doFinal(document, document.getDocumentElement());
+
+ // The EncryptedKey element is added
+ Element encryptedKeyElement = cipher.martial(document, encryptedKey);
+
+ //Create the wrapping element and set its attribute NS
+ Element wrappingElement = encryptedDoc.createElementNS(wrappingElementQName.getNamespaceURI(),
+ wrappingElementQName.getPrefix() + ":" + wrappingElementQName.getLocalPart());
+
+ wrappingElement.setAttributeNS("http://www.w3.org/2000/xmlns/",
+ "xmlns:" + wrappingElementQName.getPrefix(), wrappingElementQName.getNamespaceURI());
+
+ Element encryptedDocRootElement = encryptedDoc.getDocumentElement();
+ //Bring in the encrypted wrapping element to wrap the root node
+ encryptedDoc.replaceChild(wrappingElement, encryptedDocRootElement);
+
+ wrappingElement.appendChild(encryptedDocRootElement);
+
+ if (addEncryptedKeyInKeyInfo)
{
- //Lets check if we need an element
- NodeList nl = document.getElementsByTagName(elementTag);
- if(nl.getLength() < 1)
- throw new IllegalArgumentException(elementTag + " was not found in document");
+ // Outer ds:KeyInfo Element to hold the EncryptionKey
+ Element sigElement = encryptedDoc.createElementNS(XMLSIG_NS, "ds:KeyInfo");
+ sigElement.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ds", XMLSIG_NS);
+ sigElement.appendChild(encryptedKeyElement);
- Element elementToEncrypt = (Element) nl.item(0);
- boolean encryptContentsOnly = true;
- xmlCipher.doFinal(document,
- elementToEncrypt, encryptContentsOnly);
+ //Insert the Encrypted key before the CipherData element
+ NodeList nodeList = encryptedDocRootElement.getElementsByTagNameNS(XMLENC_NS, "CipherData");
+ if ((nodeList == null) || (nodeList.getLength() == 0))
+ throw new IllegalStateException("xenc:CipherData Element Missing");
+
+ Element cipherDataElement = (Element) nodeList.item(0);
+ encryptedDocRootElement.insertBefore(sigElement, cipherDataElement);
}
- else
+ else
{
- xmlCipher.doFinal(document, document);
+ //Add the encrypted key as a child of the wrapping element
+ wrappingElement.appendChild(encryptedKeyElement);
}
- EncryptedKey ekey = encryptKey(document, encryptingKey, publicKey);
-
- EncryptedData encryptedDataElement =
- xmlCipher.getEncryptedData();
- KeyInfo keyInfo = new KeyInfo(document);
- keyInfo.add(ekey);
- encryptedDataElement.setKeyInfo(keyInfo);
- return document;
+ return encryptedDoc.getDocumentElement();
}
+
/**
- * Decrypt the document given two keys
- * <p>The SecretKey needs to be obtained out of band or
- * needs to be obtained from the KeyInfo using the private key.
- * </p>
- * @see #encryptKey(Document, Key, Key)
- *
- * @param encryptedDocument
- * @param encryptingKey
- * @param signingKey
- * @return
+ * Decrypt an encrypted element inside a document
+ * @param documentWithEncryptedElement
+ * @param privateKey key need to unwrap the encryption key
+ * @return the document with the encrypted element replaced by the data element
* @throws Exception
*/
- public static Document decrypt(Document encryptedDocument,
- SecretKey encryptingKey, PrivateKey signingKey) throws Exception
+ public static Element decryptElementInDocument(Document documentWithEncryptedElement,
+ PrivateKey privateKey) throws Exception
{
+ if(documentWithEncryptedElement == null)
+ throw new IllegalArgumentException("Input document is null");
- XMLCipher xmlCipher = XMLCipher.getInstance();
- xmlCipher.init(XMLCipher.DECRYPT_MODE, encryptingKey); //Symmetric Key
- xmlCipher.setKEK(signingKey); //Asymmetric Key for Key Transport
+ //Look for encrypted data element
+ Element documentRoot = documentWithEncryptedElement.getDocumentElement();
+ Element encDataElement = getNextElementNode(documentRoot.getFirstChild());
+ if(encDataElement == null)
+ throw new IllegalStateException("No element representing the encrypted data found");
- //Get the encrypted element
- String namespaceURI = EncryptionConstants.EncryptionSpecNS;
- String localName = EncryptionConstants._TAG_ENCRYPTEDDATA;
+ //Look at siblings for the key
+ Element encKeyElement = getNextElementNode(encDataElement.getNextSibling());
+ if(encKeyElement == null)
+ {
+ //Search the enc data element for enc key
+ NodeList nodeList = encDataElement.getElementsByTagNameNS( XMLENC_NS, "EncryptedKey");
+
+ if(nodeList == null || nodeList.getLength() == 0)
+ throw new IllegalStateException("Encrypted Key not found in the enc data");
+
+ encKeyElement = (Element) nodeList.item(0);
+ }
+
+ XMLCipher cipher = XMLCipher.getInstance();
+ cipher.init(XMLCipher.DECRYPT_MODE, null);
+ EncryptedData encryptedData = cipher.loadEncryptedData(documentWithEncryptedElement, encDataElement);
+ EncryptedKey encryptedKey = cipher.loadEncryptedKey(documentWithEncryptedElement, encKeyElement);
+
+ Document decryptedDoc = null;
+
+ if (encryptedData != null && encryptedKey != null)
+ {
+ String encAlgoURL = encryptedData.getEncryptionMethod().getAlgorithm();
+ XMLCipher keyCipher = XMLCipher.getInstance();
+ keyCipher.init(XMLCipher.UNWRAP_MODE, privateKey);
+ Key encryptionKey = keyCipher.decryptKey( encryptedKey, encAlgoURL );
+ cipher = XMLCipher.getInstance();
+ cipher.init(XMLCipher.DECRYPT_MODE, encryptionKey);
+ decryptedDoc = cipher.doFinal(documentWithEncryptedElement, encDataElement);
+ }
+
+ Element decryptedRoot = decryptedDoc.getDocumentElement();
+ Element dataElement = getNextElementNode(decryptedRoot.getFirstChild());
+ if (dataElement == null)
+ throw new IllegalStateException("Data Element after encryption is null");
- NodeList nl = encryptedDocument.getElementsByTagNameNS(namespaceURI, localName);
- if(nl == null || nl.getLength() < 1)
- throw new IllegalStateException("Cannot find encrypted element");
- Element encryptedDataElement = (Element) nl.item(0);
- return xmlCipher.doFinal(encryptedDocument, encryptedDataElement);
+ decryptedRoot.removeChild(dataElement);
+ decryptedDoc.replaceChild(dataElement, decryptedRoot);
+
+ return decryptedDoc.getDocumentElement();
+ }
+
+ /**
+ * From the secret key, get the W3C XML Encryption URL
+ * @param publicKeyAlgo
+ * @param keySize
+ * @return
+ */
+ private static String getXMLEncryptionURLForKeyUnwrap(String publicKeyAlgo, int keySize)
+ {
+ if("AES".equals(publicKeyAlgo))
+ {
+ switch(keySize)
+ {
+ case 192: return XMLCipher.AES_192_KeyWrap;
+ case 256: return XMLCipher.AES_256_KeyWrap;
+ default:
+ return XMLCipher.AES_128_KeyWrap;
+ }
+ }
+ if(publicKeyAlgo.contains("RSA"))
+ return XMLCipher.RSA_v1dot5;
+ if(publicKeyAlgo.contains("DES"))
+ return XMLCipher.TRIPLEDES_KeyWrap;
+ throw new IllegalArgumentException("unsupported publicKey Algo:" + publicKeyAlgo);
+ }
+
+ /**
+ * From the secret key, get the W3C XML Encryption URL
+ * @param secretKey
+ * @param keySize
+ * @return
+ */
+ private static String getXMLEncryptionURL(String algo, int keySize)
+ {
+ if("AES".equals(algo))
+ {
+ switch(keySize)
+ {
+ case 192: return XMLCipher.AES_192;
+ case 256: return XMLCipher.AES_256;
+ default:
+ return XMLCipher.AES_128;
+ }
+ }
+ if(algo.contains("RSA"))
+ return XMLCipher.RSA_v1dot5;
+ if(algo.contains("DES"))
+ return XMLCipher.TRIPLEDES_KeyWrap;
+ throw new IllegalArgumentException("Secret Key with unsupported algo:" + algo);
+ }
+
+ /**
+ * Returns the next Element node.
+ */
+ private static Element getNextElementNode(Node node)
+ {
+ while(node != null)
+ {
+ if(Node.ELEMENT_NODE == node.getNodeType())
+ return (Element) node;
+ node = node.getNextSibling();
+ }
+ return null;
}
}
\ No newline at end of file
Deleted: identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/XMLEncryptionUnitTestCase.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/XMLEncryptionUnitTestCase.java 2009-02-04 23:04:06 UTC (rev 306)
+++ identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/XMLEncryptionUnitTestCase.java 2009-02-09 03:41:50 UTC (rev 307)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.identity.federation.api.saml.v2;
-
-import java.io.StringReader;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-
-import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-import org.jboss.identity.federation.api.util.XMLEncryptionUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-
-/**
- * Unit Test the XML Encryption Util
- * @author Anil.Saldhana(a)redhat.com
- * @since Feb 4, 2009
- */
-public class XMLEncryptionUnitTestCase extends TestCase
-{
- private String docString = "<rootDoc><element><childOfEl/></element></rootDoc>";
-
- /**
- * Test the encryption of an entire document using a symmetric key
- * @throws Exception
- */
- public void testEncryptEntireDocumentWithSymmetricKey() throws Exception
- {
- Document doc = this.getDocument();
- KeyPair kp = this.getKeyPair("RSA");
-
- SecretKey sk = getSecretKey();
- Document edoc = XMLEncryptionUtil.encrypt(doc, null, sk, kp.getPublic(),
- XMLEncryptionUtil.AES_128);
- assertEquals("xenc:EncryptedData", edoc.getFirstChild().getNodeName());
-
- //XMLSignatureUtil.marshall(edoc, System.out);
-
- Document rdoc = XMLEncryptionUtil.decrypt(edoc, sk, kp.getPrivate());
- //XMLSignatureUtil.marshall(rdoc, System.out);
- String nodeName = rdoc.getFirstChild().getNodeName();
- assertEquals("rootDoc",nodeName);
- }
-
- /**
- * Test the encryption of an element inside a document using
- * a symmetric key
- * @throws Exception
- */
- public void testEncryptElementWithSymmetricKey() throws Exception
- {
- Document doc = this.getDocument();
- KeyPair kp = this.getKeyPair("RSA");
-
- SecretKey sk = getSecretKey();
- Document edoc = XMLEncryptionUtil.encrypt(doc, "element", sk, kp.getPublic(),
- XMLEncryptionUtil.AES_128);
- Element encEl = (Element) edoc.getElementsByTagName("element").item(0);
- assertEquals("xenc:EncryptedData", encEl.getFirstChild().getNodeName());
-
- Document rdoc = XMLEncryptionUtil.decrypt(edoc, sk, kp.getPrivate());
- String nodeName = rdoc.getFirstChild().getNodeName();
- assertEquals("rootDoc",nodeName);
- }
-
- private KeyPair getKeyPair(String algo) throws Exception
- {
- KeyPairGenerator kpg = KeyPairGenerator.getInstance(algo);
- return kpg.genKeyPair();
- }
-
- private Document getDocument() throws Exception
- {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- return builder.parse(new InputSource(new StringReader(docString)));
- }
-
- private SecretKey getSecretKey() throws Exception
- {
- KeyGenerator keyGenerator =
- KeyGenerator.getInstance("AES");
- keyGenerator.init(128);
- return keyGenerator.generateKey();
- }
-}
\ No newline at end of file
Added: identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/DocumentUtilUnitTestCase.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/DocumentUtilUnitTestCase.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/DocumentUtilUnitTestCase.java 2009-02-09 03:41:50 UTC (rev 307)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.identity.federation.api.util;
+
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.xml.security.utils.EncryptionConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Unit Test the DocumentUtil
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 6, 2009
+ */
+public class DocumentUtilUnitTestCase extends TestCase
+{
+ public void testReadSAMLEncryptedAssertion() throws Exception
+ {
+ Document encDoc = getDocument();
+ Element encryptedDataElement =
+ (Element) encDoc.getElementsByTagNameNS(
+ EncryptionConstants.EncryptionSpecNS,
+ EncryptionConstants._TAG_ENCRYPTEDDATA).item(0);
+ Element encryptedKeyElement =
+ (Element) encryptedDataElement.getElementsByTagNameNS(
+ EncryptionConstants.EncryptionSpecNS,
+ EncryptionConstants._TAG_ENCRYPTEDKEY).item(0);
+ assertNotNull(encryptedDataElement);
+ assertNotNull(encryptedKeyElement);
+ }
+
+ private Document getDocument() throws Exception
+ {
+ String fileName = "xml/dom/enc-sample.xml";
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName);
+ if(is == null)
+ throw new RuntimeException("InputStream is null");
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ return builder.parse(is);
+ }
+
+}
Added: identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/XMLEncryptionUnitTestCase.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/XMLEncryptionUnitTestCase.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/util/XMLEncryptionUnitTestCase.java 2009-02-09 03:41:50 UTC (rev 307)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.identity.federation.api.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.StringWriter;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.jboss.identity.federation.api.saml.v2.common.IDGenerator;
+import org.jboss.identity.federation.api.saml.v2.response.SAML2Response;
+import org.jboss.identity.federation.api.util.XMLEncryptionUtil;
+import org.jboss.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
+import org.jboss.identity.federation.core.saml.v2.holders.IDPInfoHolder;
+import org.jboss.identity.federation.core.saml.v2.holders.IssuerInfoHolder;
+import org.jboss.identity.federation.core.saml.v2.holders.SPInfoHolder;
+import org.jboss.identity.federation.core.saml.v2.util.DocumentUtil;
+import org.jboss.identity.federation.saml.v2.assertion.AssertionType;
+import org.jboss.identity.federation.saml.v2.assertion.AttributeStatementType;
+import org.jboss.identity.federation.saml.v2.assertion.EncryptedElementType;
+import org.jboss.identity.federation.saml.v2.protocol.ResponseType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+/**
+ * Unit Test the XML Encryption Utility
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 5, 2009
+ */
+public class XMLEncryptionUnitTestCase extends TestCase
+{
+ SAML2Response sr = new SAML2Response();
+
+ public void testEncryptAssertion() throws Exception
+ {
+ KeyPair kp = this.getKeyPair("RSA");
+ SecretKey sk = this.getSecretKey();
+
+ ResponseType rt = createResponse();
+ Document responseDoc = sr.convert(rt);
+
+ String assertionNS = JBossSAMLURIConstants.ASSERTION_NSURI.get();
+
+ QName assertionQName = new QName(assertionNS, "EncryptedAssertion", "saml");
+
+ Element docElement = XMLEncryptionUtil.encryptElementInDocument(responseDoc,kp.getPublic(), sk,
+ 128, assertionQName, true);
+
+ EncryptedElementType eet = sr.getEncryptedAssertion(DocumentUtil.getNodeAsStream(docElement));
+ rt.getAssertionOrEncryptedAssertion().set(0,eet);
+
+ EncryptedElementType myeet = (EncryptedElementType) rt.getAssertionOrEncryptedAssertion().get(0);
+ Document eetDoc = sr.convert(myeet);
+
+ Element decryptedDocumentElement = XMLEncryptionUtil.decryptElementInDocument(eetDoc,kp.getPrivate());
+
+ //Let us use the encrypted doc element to decrypt it
+ ResponseType newRT = sr.getResponseType(DocumentUtil.getNodeAsStream(decryptedDocumentElement));
+
+ AssertionType assertion = (AssertionType) newRT.getAssertionOrEncryptedAssertion().get(0);
+ assertEquals("http://identityurl", assertion.getIssuer().getValue());
+
+ }
+
+ public void testEncryptAssertionWithMarshalling() throws Exception
+ {
+ KeyPair kp = this.getKeyPair("RSA");
+ SecretKey sk = this.getSecretKey();
+
+ ResponseType rt = createResponse();
+ Document responseDoc = sr.convert(rt);
+
+ String assertionNS = JBossSAMLURIConstants.ASSERTION_NSURI.get();
+
+ QName assertionQName = new QName(assertionNS, "EncryptedAssertion", "saml");
+
+ Element docElement = XMLEncryptionUtil.encryptElementInDocument(responseDoc,kp.getPublic(), sk,
+ 128, assertionQName, true);
+
+ EncryptedElementType eet = sr.getEncryptedAssertion(DocumentUtil.getNodeAsStream(docElement));
+ rt.getAssertionOrEncryptedAssertion().set(0,eet);
+
+ StringWriter sw = new StringWriter();
+ sr.marshall(rt, sw);
+
+ //Create a brand new ResponseType
+ ResponseType received = sr.getResponseType(new ByteArrayInputStream(sw.toString().getBytes("UTF-8")));
+
+ EncryptedElementType myeet = (EncryptedElementType) received.getAssertionOrEncryptedAssertion().get(0);
+ Document eetDoc = sr.convert(myeet);
+
+ Element decryptedDocumentElement = XMLEncryptionUtil.decryptElementInDocument(eetDoc,kp.getPrivate());
+
+ //Let us use the encrypted doc element to decrypt it
+ ResponseType newRT = sr.getResponseType(DocumentUtil.getNodeAsStream(decryptedDocumentElement));
+
+ AssertionType assertion = (AssertionType) newRT.getAssertionOrEncryptedAssertion().get(0);
+ assertEquals("http://identityurl", assertion.getIssuer().getValue());
+ }
+
+ private ResponseType createResponse() throws Exception
+ {
+ List<String> roles = new ArrayList<String>();
+ roles.add("roleA");
+ roles.add("roleB");
+
+ ResponseType responseType = null;
+
+ SAML2Response saml2Response = new SAML2Response();
+
+ //Create a response type
+ String id = IDGenerator.create("ID_");
+
+ IssuerInfoHolder issuerHolder = new IssuerInfoHolder("http://identityurl");
+ issuerHolder.setStatusCode(JBossSAMLURIConstants.STATUS_SUCCESS.get());
+
+ IDPInfoHolder idp = new IDPInfoHolder();
+ idp.setNameIDFormatValue("testPrincipal");
+ idp.setNameIDFormat(JBossSAMLURIConstants.NAMEID_FORMAT_PERSISTENT.get());
+
+ SPInfoHolder sp = new SPInfoHolder();
+ sp.setResponseDestinationURI("http://service");
+ responseType = saml2Response.createResponseType(id, sp, idp, issuerHolder);
+ AssertionType assertion = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);
+
+ AttributeStatementType attrStatement = saml2Response.createAttributeStatement(roles);
+ assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(attrStatement);
+
+ //Add timed conditions
+ saml2Response.createTimedConditions(assertion, 5000L);
+
+ return responseType;
+ }
+
+ private KeyPair getKeyPair(String algo) throws Exception
+ {
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(algo);
+ return kpg.genKeyPair();
+ }
+
+ private SecretKey getSecretKey() throws Exception
+ {
+ KeyGenerator keyGenerator =
+ KeyGenerator.getInstance("AES");
+ keyGenerator.init(128);
+ return keyGenerator.generateKey();
+ }
+}
\ No newline at end of file
Added: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/resolver.jar
===================================================================
(Binary files differ)
Property changes on: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/resolver.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/serializer.jar
===================================================================
(Binary files differ)
Property changes on: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/serializer.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xalan.jar
===================================================================
(Binary files differ)
Property changes on: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xalan.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xercesImpl.jar
===================================================================
(Binary files differ)
Property changes on: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xercesImpl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xml-apis.jar
===================================================================
(Binary files differ)
Property changes on: identity-federation/trunk/identity-fed-api/src/test/resources/endorsed/xml-apis.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: identity-federation/trunk/identity-fed-api/src/test/resources/xml/dom/enc-sample.xml
===================================================================
--- identity-federation/trunk/identity-fed-api/src/test/resources/xml/dom/enc-sample.xml (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/test/resources/xml/dom/enc-sample.xml 2009-02-09 03:41:50 UTC (rev 307)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<saml:EncryptedAssertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
+ <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
+ Type="http://www.w3.org/2001/04/xmlenc#Element">
+ <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"
+ xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" />
+ <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
+ <xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
+ <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"
+ xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" />
+ <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
+ <xenc:CipherValue xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
+ Y9X5QW+M4gCrvkYo6v0CkDm9lR5/+mF+UxXCgge/KmkFXSHrHhmEHL0kmcPgnYXkufENNOGZkNsT
+ MTF0sHVEAC+rbf+ZyOgl44jZUD4KtBo+Fgl6ddLBgIcTTFGQ3WscdJForQPYp2rekHyw4YlbLDSq
+ 5/di4fDS7BVz6mKdEBM=</xenc:CipherValue>
+ </xenc:CipherData>
+ </xenc:EncryptedKey>
+ </ds:KeyInfo>
+ <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
+ <xenc:CipherValue xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
+ MNLeaBXwfU4vtuhEUEKH190Z46OIdNBmK4yjaKh2QR0DH7xksoQAX+OjU4CJhVB6fZRxitn0Sau0
+ zejUE2U5igLHpyrjONmwLh9imubqFZHMzLbiqDWlyjMHnVF .....
+ ZPHNjad9sON9QtSnW7uApjUdkcPPpRlE0K2gX3xG07EmRIcWLsMo0AwtYXYW4CFq1rXWF22pfgVv
+ Bcw1XvGUevgAcgMOtK7aFm6y5QZgIypIGs90GeLKwH6xZGaFg1xFDo+kiLA+KFg1vHVYxqcKcSgy
+ ZtnthwhqWdxHTBWar7aY+QC9lEV3FAp0deSNOGl78SyvKw==</xenc:CipherValue>
+ </xenc:CipherData>
+ </xenc:EncryptedData>
+</saml:EncryptedAssertion>
\ No newline at end of file
15 years, 2 months
JBoss Identity SVN: r306 - in identity-federation/trunk/identity-fed-api/src: test/java/org/jboss/test/identity/federation/api/saml/v2 and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-04 18:04:06 -0500 (Wed, 04 Feb 2009)
New Revision: 306
Added:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java
identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/XMLEncryptionUnitTestCase.java
Log:
JBID-47: xml enc util
Added: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/util/XMLEncryptionUtil.java 2009-02-04 23:04:06 UTC (rev 306)
@@ -0,0 +1,203 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.federation.api.util;
+
+import java.security.Key;
+import java.security.PrivateKey;
+
+import javax.crypto.SecretKey;
+
+import org.apache.xml.security.encryption.EncryptedData;
+import org.apache.xml.security.encryption.EncryptedKey;
+import org.apache.xml.security.encryption.XMLCipher;
+import org.apache.xml.security.keys.KeyInfo;
+import org.apache.xml.security.utils.EncryptionConstants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * XML Encryption Util
+ * <b>Note: </b> This utility is currently using Apache XML Security
+ * library API. JSR-106 is not yet final. Until that happens,we
+ * rely on the non-standard API.
+ *
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 4, 2009
+ */
+public class XMLEncryptionUtil
+{
+ public static final String TRIPLEDES = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc";
+
+ public static final String AES_128 = "http://www.w3.org/2001/04/xmlenc#aes128-cbc";
+
+ public static final String AES_256 = "http://www.w3.org/2001/04/xmlenc#aes256-cbc";
+
+ public static final String AES_192 = "http://www.w3.org/2001/04/xmlenc#aes192-cbc";
+
+ public static final String RSA_v1dot5 = "http://www.w3.org/2001/04/xmlenc#rsa-1_5";
+
+ public static final String RSA_OAEP = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p";
+
+ public static final String DIFFIE_HELLMAN = "http://www.w3.org/2001/04/xmlenc#dh";
+
+ public static final String TRIPLEDES_KeyWrap = "http://www.w3.org/2001/04/xmlenc#kw-tripledes";
+
+ public static final String AES_128_KeyWrap = "http://www.w3.org/2001/04/xmlenc#kw-aes128";
+
+ public static final String AES_256_KeyWrap = "http://www.w3.org/2001/04/xmlenc#kw-aes256";
+
+ public static final String AES_192_KeyWrap = "http://www.w3.org/2001/04/xmlenc#kw-aes192";
+
+ public static final String SHA1 = "http://www.w3.org/2000/09/xmldsig#sha1";
+
+ public static final String SHA256 = "http://www.w3.org/2001/04/xmlenc#sha256";
+
+ public static final String SHA512 = "http://www.w3.org/2001/04/xmlenc#sha512";
+
+ public static final String RIPEMD_160 = "http://www.w3.org/2001/04/xmlenc#ripemd160";
+
+ public static final String XML_DSIG = "http://www.w3.org/2000/09/xmldsig#";
+
+ public static final String N14C_XML = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
+
+ public static final String N14C_XML_WITH_COMMENTS = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";
+
+ public static final String EXCL_XML_N14C = "http://www.w3.org/2001/10/xml-exc-c14n#";
+
+ public static final String EXCL_XML_N14C_WITH_COMMENTS = "http://www.w3.org/2001/10/xml-exc-c14n#WithComments";
+
+ public static final String BASE64_ENCODING = "http://www.w3.org/2000/09/xmldsig#base64";
+
+ static
+ {
+ //Initialize the XML Security Library
+ org.apache.xml.security.Init.init();
+ }
+
+ /**
+ * <p>
+ * Encrypt the Key to be transported
+ * </p>
+ * <p>
+ * Data is encrypted with a SecretKey. Then the key needs to be
+ * transported to the other end where it is needed for decryption.
+ * For the Key transport, the SecretKey is encrypted with the
+ * recipient's public key. At the receiving end, the receiver
+ * can decrypt the Secret Key using his private key.s
+ * </p>
+ * @param document
+ * @param keyToBeEncrypted Symmetric Key (SecretKey)
+ * @param keyUsedToEncrypt Asymmetric Key (Public Key)
+ * @return
+ * @throws Exception
+ */
+ public static EncryptedKey encryptKey(Document document,
+ Key keyToBeEncrypted, Key keyUsedToEncrypt) throws Exception
+ {
+ XMLCipher keyCipher = null;
+ String keyAlgo = keyUsedToEncrypt.getAlgorithm();
+ if("RSA".equals(keyAlgo))
+ keyCipher = XMLCipher.getInstance(XMLEncryptionUtil.RSA_v1dot5);
+ else
+ keyCipher = XMLCipher.getInstance(XMLEncryptionUtil.TRIPLEDES_KeyWrap);
+
+ keyCipher.init(XMLCipher.WRAP_MODE, keyUsedToEncrypt);
+ return keyCipher.encryptKey(document, keyToBeEncrypted);
+ }
+
+ /**
+ * Encrypt either the entire document or an element within provided by the tag
+ * @param document The Document to encrypt
+ * @param elementTag An element in the document that you want encrypted (or null indicating entire document)
+ * @param encryptingKey
+ * @param algo
+ * @return document that is encrypted or contains the encrypted element
+ * @throws Exception
+ */
+ public static Document encrypt(Document document, String elementTag,
+ SecretKey encryptingKey, Key publicKey, String algo) throws Exception
+ {
+ XMLCipher xmlCipher = XMLCipher.getInstance(algo);
+ if(xmlCipher == null)
+ throw new IllegalStateException("Cipher is null for algorithm:" + algo);
+ xmlCipher.init(XMLCipher.ENCRYPT_MODE, encryptingKey);
+
+ if(elementTag != null)
+ {
+ //Lets check if we need an element
+ NodeList nl = document.getElementsByTagName(elementTag);
+ if(nl.getLength() < 1)
+ throw new IllegalArgumentException(elementTag + " was not found in document");
+
+ Element elementToEncrypt = (Element) nl.item(0);
+ boolean encryptContentsOnly = true;
+ xmlCipher.doFinal(document,
+ elementToEncrypt, encryptContentsOnly);
+ }
+ else
+ {
+ xmlCipher.doFinal(document, document);
+ }
+ EncryptedKey ekey = encryptKey(document, encryptingKey, publicKey);
+
+ EncryptedData encryptedDataElement =
+ xmlCipher.getEncryptedData();
+ KeyInfo keyInfo = new KeyInfo(document);
+ keyInfo.add(ekey);
+ encryptedDataElement.setKeyInfo(keyInfo);
+
+ return document;
+ }
+
+ /**
+ * Decrypt the document given two keys
+ * <p>The SecretKey needs to be obtained out of band or
+ * needs to be obtained from the KeyInfo using the private key.
+ * </p>
+ * @see #encryptKey(Document, Key, Key)
+ *
+ * @param encryptedDocument
+ * @param encryptingKey
+ * @param signingKey
+ * @return
+ * @throws Exception
+ */
+ public static Document decrypt(Document encryptedDocument,
+ SecretKey encryptingKey, PrivateKey signingKey) throws Exception
+ {
+
+ XMLCipher xmlCipher = XMLCipher.getInstance();
+ xmlCipher.init(XMLCipher.DECRYPT_MODE, encryptingKey); //Symmetric Key
+ xmlCipher.setKEK(signingKey); //Asymmetric Key for Key Transport
+
+ //Get the encrypted element
+ String namespaceURI = EncryptionConstants.EncryptionSpecNS;
+ String localName = EncryptionConstants._TAG_ENCRYPTEDDATA;
+
+ NodeList nl = encryptedDocument.getElementsByTagNameNS(namespaceURI, localName);
+ if(nl == null || nl.getLength() < 1)
+ throw new IllegalStateException("Cannot find encrypted element");
+ Element encryptedDataElement = (Element) nl.item(0);
+ return xmlCipher.doFinal(encryptedDocument, encryptedDataElement);
+ }
+}
\ No newline at end of file
Added: identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/XMLEncryptionUnitTestCase.java
===================================================================
--- identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/XMLEncryptionUnitTestCase.java (rev 0)
+++ identity-federation/trunk/identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/XMLEncryptionUnitTestCase.java 2009-02-04 23:04:06 UTC (rev 306)
@@ -0,0 +1,112 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.identity.federation.api.saml.v2;
+
+import java.io.StringReader;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.jboss.identity.federation.api.util.XMLEncryptionUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
+/**
+ * Unit Test the XML Encryption Util
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 4, 2009
+ */
+public class XMLEncryptionUnitTestCase extends TestCase
+{
+ private String docString = "<rootDoc><element><childOfEl/></element></rootDoc>";
+
+ /**
+ * Test the encryption of an entire document using a symmetric key
+ * @throws Exception
+ */
+ public void testEncryptEntireDocumentWithSymmetricKey() throws Exception
+ {
+ Document doc = this.getDocument();
+ KeyPair kp = this.getKeyPair("RSA");
+
+ SecretKey sk = getSecretKey();
+ Document edoc = XMLEncryptionUtil.encrypt(doc, null, sk, kp.getPublic(),
+ XMLEncryptionUtil.AES_128);
+ assertEquals("xenc:EncryptedData", edoc.getFirstChild().getNodeName());
+
+ //XMLSignatureUtil.marshall(edoc, System.out);
+
+ Document rdoc = XMLEncryptionUtil.decrypt(edoc, sk, kp.getPrivate());
+ //XMLSignatureUtil.marshall(rdoc, System.out);
+ String nodeName = rdoc.getFirstChild().getNodeName();
+ assertEquals("rootDoc",nodeName);
+ }
+
+ /**
+ * Test the encryption of an element inside a document using
+ * a symmetric key
+ * @throws Exception
+ */
+ public void testEncryptElementWithSymmetricKey() throws Exception
+ {
+ Document doc = this.getDocument();
+ KeyPair kp = this.getKeyPair("RSA");
+
+ SecretKey sk = getSecretKey();
+ Document edoc = XMLEncryptionUtil.encrypt(doc, "element", sk, kp.getPublic(),
+ XMLEncryptionUtil.AES_128);
+ Element encEl = (Element) edoc.getElementsByTagName("element").item(0);
+ assertEquals("xenc:EncryptedData", encEl.getFirstChild().getNodeName());
+
+ Document rdoc = XMLEncryptionUtil.decrypt(edoc, sk, kp.getPrivate());
+ String nodeName = rdoc.getFirstChild().getNodeName();
+ assertEquals("rootDoc",nodeName);
+ }
+
+ private KeyPair getKeyPair(String algo) throws Exception
+ {
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance(algo);
+ return kpg.genKeyPair();
+ }
+
+ private Document getDocument() throws Exception
+ {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ return builder.parse(new InputSource(new StringReader(docString)));
+ }
+
+ private SecretKey getSecretKey() throws Exception
+ {
+ KeyGenerator keyGenerator =
+ KeyGenerator.getInstance("AES");
+ keyGenerator.init(128);
+ return keyGenerator.generateKey();
+ }
+}
\ No newline at end of file
15 years, 3 months
JBoss Identity SVN: r305 - idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-02-03 13:42:58 -0500 (Tue, 03 Feb 2009)
New Revision: 305
Added:
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/SecurityActions.java
Modified:
idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
Log:
JBID-44: priv blocks
Modified: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-02-03 18:32:35 UTC (rev 304)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-02-03 18:42:58 UTC (rev 305)
@@ -104,7 +104,7 @@
public static IdentityConfigurationMetaData createConfigurationMetaData(String configResource) throws IdentityConfigurationException
{
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader classLoader = SecurityActions.getContextClassLoader();
InputStream inputStream = classLoader.getResourceAsStream(configResource);
if (inputStream == null)
{
Added: idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/SecurityActions.java
===================================================================
--- idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/SecurityActions.java (rev 0)
+++ idm/trunk/idm/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/SecurityActions.java 2009-02-03 18:42:58 UTC (rev 305)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.identity.idm.impl.configuration.jaxb2;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Privileged Blocks
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Feb 3, 2009
+ */
+class SecurityActions
+{
+ /**
+ * Get the Thread Context CL
+ * @return
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+
+}
\ No newline at end of file
15 years, 3 months