From b97b768ba705935caf67352a143586faa0b2371f Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 23 Dec 2008 16:12:09 +0000 Subject: saml:AnyType workaround for xs:anyType (SubjectConfirmationData und AttributeValue) git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@257 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/idlink/IdentityLinkFactory.java | 212 +++++++++++---------- .../names/tc/saml/_1_0/assertion/ActionType.java | 4 +- .../names/tc/saml/_1_0/assertion/AdviceType.java | 12 +- .../names/tc/saml/_1_0/assertion/AnyType.java | 79 ++++++++ .../tc/saml/_1_0/assertion/AssertionType.java | 14 +- .../_1_0/assertion/AttributeDesignatorType.java | 4 +- .../_1_0/assertion/AttributeStatementType.java | 4 +- .../tc/saml/_1_0/assertion/AttributeType.java | 12 +- .../AudienceRestrictionConditionType.java | 4 +- .../assertion/AuthenticationStatementType.java | 4 +- .../saml/_1_0/assertion/AuthorityBindingType.java | 4 +- .../AuthorizationDecisionStatementType.java | 4 +- .../saml/_1_0/assertion/ConditionAbstractType.java | 4 +- .../tc/saml/_1_0/assertion/ConditionsType.java | 4 +- .../names/tc/saml/_1_0/assertion/DecisionType.java | 4 +- .../names/tc/saml/_1_0/assertion/EvidenceType.java | 4 +- .../tc/saml/_1_0/assertion/NameIdentifierType.java | 4 +- .../tc/saml/_1_0/assertion/ObjectFactory.java | 108 ++++++----- .../saml/_1_0/assertion/StatementAbstractType.java | 4 +- .../_1_0/assertion/SubjectConfirmationType.java | 14 +- .../saml/_1_0/assertion/SubjectLocalityType.java | 4 +- .../assertion/SubjectStatementAbstractType.java | 4 +- .../names/tc/saml/_1_0/assertion/SubjectType.java | 4 +- .../names/tc/saml/_1_0/assertion/package-info.java | 4 +- .../test/java/saml/KeyValueAttributeTypeTest.java | 129 +++++++++++++ 25 files changed, 435 insertions(+), 213 deletions(-) create mode 100644 utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AnyType.java create mode 100644 utils/src/test/java/saml/KeyValueAttributeTypeTest.java (limited to 'utils') diff --git a/utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java b/utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java index a5ceeafc..28f421a4 100644 --- a/utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java +++ b/utils/src/main/java/at/gv/egiz/idlink/IdentityLinkFactory.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package at.gv.egiz.idlink; - +package at.gv.egiz.idlink; + import iaik.xml.crypto.XmldsigMore; import java.io.InputStreamReader; @@ -88,63 +88,64 @@ import at.gv.e_government.reference.namespace.persondata._20020228_.Identificati import at.gv.e_government.reference.namespace.persondata._20020228_.PersonNameType.FamilyName; import at.gv.egiz.xmldsig.KeyTypeNotSupportedException; import at.gv.egiz.xmldsig.KeyValueFactory; - +import oasis.names.tc.saml._1_0.assertion.AnyType; + public class IdentityLinkFactory { - private static Log log = LogFactory.getLog(IdentityLinkFactory.class); - - /** - * The instance returned by {@link #getInstance()}. - */ - private static IdentityLinkFactory instance; - - /** - * The JAXBContext. - */ - private static JAXBContext jaxbContext; - - /** - * The KeyValueFactory. - */ - private static KeyValueFactory keyValueFactory; - - /** - * Get an instance of this CompressedIdentityLinkFactory. - * - * @return an instance of this CompressedIdentityLinkFactory - */ - public synchronized static IdentityLinkFactory getInstance() { - if (instance == null) { - instance = new IdentityLinkFactory(); - } - return instance; - } - - /** - * Private constructor. - */ - private IdentityLinkFactory() { - - keyValueFactory = new KeyValueFactory(); - - StringBuffer packageNames = new StringBuffer(); - packageNames.append(at.gv.e_government.reference.namespace.persondata._20020228_.ObjectFactory.class.getPackage().getName()); - packageNames.append(":"); - packageNames.append(org.w3._2000._09.xmldsig_.ObjectFactory.class.getPackage().getName()); - packageNames.append(":"); - packageNames.append(org.w3._2001._04.xmldsig_more_.ObjectFactory.class.getPackage().getName()); - packageNames.append(":"); - packageNames.append(at.buergerkarte.namespaces.personenbindung._20020506_.ObjectFactory.class.getPackage().getName()); + private static Log log = LogFactory.getLog(IdentityLinkFactory.class); + + /** + * The instance returned by {@link #getInstance()}. + */ + private static IdentityLinkFactory instance; + + /** + * The JAXBContext. + */ + private static JAXBContext jaxbContext; + + /** + * The KeyValueFactory. + */ + private static KeyValueFactory keyValueFactory; + + /** + * Get an instance of this CompressedIdentityLinkFactory. + * + * @return an instance of this CompressedIdentityLinkFactory + */ + public synchronized static IdentityLinkFactory getInstance() { + if (instance == null) { + instance = new IdentityLinkFactory(); + } + return instance; + } + + /** + * Private constructor. + */ + private IdentityLinkFactory() { + + keyValueFactory = new KeyValueFactory(); + + StringBuffer packageNames = new StringBuffer(); + packageNames.append(at.gv.e_government.reference.namespace.persondata._20020228_.ObjectFactory.class.getPackage().getName()); + packageNames.append(":"); + packageNames.append(org.w3._2000._09.xmldsig_.ObjectFactory.class.getPackage().getName()); + packageNames.append(":"); + packageNames.append(org.w3._2001._04.xmldsig_more_.ObjectFactory.class.getPackage().getName()); + packageNames.append(":"); + packageNames.append(at.buergerkarte.namespaces.personenbindung._20020506_.ObjectFactory.class.getPackage().getName()); packageNames.append(":"); packageNames.append(oasis.names.tc.saml._1_0.assertion.ObjectFactory.class.getPackage().getName()); - - try { - jaxbContext = JAXBContext.newInstance(packageNames.toString()); - } catch (JAXBException e) { - // we should not get an JAXBException initializing the JAXBContext - throw new RuntimeException(e); - } - + + try { + jaxbContext = JAXBContext.newInstance(packageNames.toString()); + } catch (JAXBException e) { + // we should not get an JAXBException initializing the JAXBContext + throw new RuntimeException(e); + } + } public JAXBElement createAssertion(String assertionId, @@ -175,11 +176,11 @@ public class IdentityLinkFactory { return asFactory.createAssertion(assertionType); - } - + } + public AttributeStatementType createAttributeStatement(String idValue, String idType, String givenName, String familyName, String dateOfBirth, - PublicKey[] publicKeys) throws KeyTypeNotSupportedException { + PublicKey[] publicKeys) throws KeyTypeNotSupportedException { oasis.names.tc.saml._1_0.assertion.ObjectFactory asFactory = new oasis.names.tc.saml._1_0.assertion.ObjectFactory(); @@ -215,8 +216,11 @@ public class IdentityLinkFactory { physicalPersonType.getIdentification().add(identificationType); physicalPersonType.setName(personNameType); physicalPersonType.setDateOfBirth(dateOfBirth); - - subjectConfirmationType.setSubjectConfirmationData(physicalPersonType); + JAXBElement physicalPerson = prFactory.createPhysicalPerson(physicalPersonType); + + AnyType personType = asFactory.createAnyType(); + personType.getContent().add(physicalPerson); + subjectConfirmationType.setSubjectConfirmationData(personType); JAXBElement subjectConfirmation = asFactory.createSubjectConfirmation(subjectConfirmationType); @@ -232,52 +236,54 @@ public class IdentityLinkFactory { AttributeType attributeType = asFactory.createAttributeType(); attributeType.setAttributeName("CitizenPublicKey"); attributeType.setAttributeNamespace("urn:publicid:gv.at:namespaces:identitylink:1.2"); - attributeType.getAttributeValue().add(createKeyValue.getValue()); + AnyType attributeValueType = asFactory.createAnyType(); + attributeValueType.getContent().add(createKeyValue); + attributeType.getAttributeValue().add(attributeValueType); attributeStatementType.getAttribute().add(attributeType); } return attributeStatementType; - } - - /** - * Marshall the given compressedIdentityLink into a DOM document - * with the given Nodes as parent and nextSibling - * nodes. - * - * @param identityLink - * the CompressedIdentityLink element - * @param parent - * the parent node - * @param nextSibling - * the next sibling node (may be null) - * @param applyWorkarounds - * apply workarounds as spefiyed by - * {@link #applyWorkarounds(Element, int)} - * - * @throws JAXBException - * if an unexpected error occurs while marshalling - * @throws NullPointerException - * if compressdIdentityLink or parent is - * null - */ - public void marshallIdentityLink( - JAXBElement identityLink, - Node parent, Node nextSibling) throws JAXBException { - - DOMResult result = new DOMResult(parent, nextSibling); - - try { - Marshaller marshaller = jaxbContext.createMarshaller(); - - marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); - - marshaller.marshal(identityLink, result); - } catch (PropertyException e) { - throw new RuntimeException(e); - } - + } + + /** + * Marshall the given compressedIdentityLink into a DOM document + * with the given Nodes as parent and nextSibling + * nodes. + * + * @param identityLink + * the CompressedIdentityLink element + * @param parent + * the parent node + * @param nextSibling + * the next sibling node (may be null) + * @param applyWorkarounds + * apply workarounds as spefiyed by + * {@link #applyWorkarounds(Element, int)} + * + * @throws JAXBException + * if an unexpected error occurs while marshalling + * @throws NullPointerException + * if compressdIdentityLink or parent is + * null + */ + public void marshallIdentityLink( + JAXBElement identityLink, + Node parent, Node nextSibling) throws JAXBException { + + DOMResult result = new DOMResult(parent, nextSibling); + + try { + Marshaller marshaller = jaxbContext.createMarshaller(); + + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + + marshaller.marshal(identityLink, result); + } catch (PropertyException e) { + throw new RuntimeException(e); + } + } public void signIdentityLink(Element assertion, X509Certificate certificate, @@ -416,6 +422,6 @@ public class IdentityLinkFactory { log.trace(sb.toString()); } - } - -} + } + +} diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ActionType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ActionType.java index 144b4e17..d2b96381 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ActionType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ActionType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AdviceType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AdviceType.java index e5342409..d2630fac 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AdviceType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AdviceType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // @@ -32,7 +32,7 @@ import org.w3c.dom.Element; * <choice maxOccurs="unbounded" minOccurs="0"> * <element ref="{urn:oasis:names:tc:SAML:1.0:assertion}AssertionIDReference"/> * <element ref="{urn:oasis:names:tc:SAML:1.0:assertion}Assertion"/> - * <any/> + * <any processContents='lax' namespace='##other'/> * </choice> * </restriction> * </complexContent> @@ -72,10 +72,10 @@ public class AdviceType { * *

* Objects of the following type(s) are allowed in the list - * {@link Object } - * {@link JAXBElement }{@code <}{@link String }{@code >} - * {@link JAXBElement }{@code <}{@link AssertionType }{@code >} * {@link Element } + * {@link JAXBElement }{@code <}{@link AssertionType }{@code >} + * {@link JAXBElement }{@code <}{@link String }{@code >} + * {@link Object } * * */ diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AnyType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AnyType.java new file mode 100644 index 00000000..82a221a7 --- /dev/null +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AnyType.java @@ -0,0 +1,79 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2008.12.23 at 03:26:53 PM GMT +// + + +package oasis.names.tc.saml._1_0.assertion; + +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.XmlAnyElement; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for AnyType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AnyType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <any/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AnyType", propOrder = { + "content" +}) +public class AnyType { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * 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 set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContent().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Object } + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AssertionType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AssertionType.java index 2157dd67..2a108984 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AssertionType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AssertionType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // @@ -70,10 +70,10 @@ public class AssertionType { protected AdviceType advice; @XmlElements({ @XmlElement(name = "Statement"), - @XmlElement(name = "AuthorizationDecisionStatement", type = AuthorizationDecisionStatementType.class), - @XmlElement(name = "AuthenticationStatement", type = AuthenticationStatementType.class), + @XmlElement(name = "AttributeStatement", type = AttributeStatementType.class), @XmlElement(name = "SubjectStatement", type = SubjectStatementAbstractType.class), - @XmlElement(name = "AttributeStatement", type = AttributeStatementType.class) + @XmlElement(name = "AuthorizationDecisionStatement", type = AuthorizationDecisionStatementType.class), + @XmlElement(name = "AuthenticationStatement", type = AuthenticationStatementType.class) }) protected List statementOrSubjectStatementOrAuthenticationStatement; @XmlElement(name = "Signature", namespace = "http://www.w3.org/2000/09/xmldsig#") @@ -157,10 +157,10 @@ public class AssertionType { *

* Objects of the following type(s) are allowed in the list * {@link StatementAbstractType } + * {@link AttributeStatementType } + * {@link SubjectStatementAbstractType } * {@link AuthorizationDecisionStatementType } * {@link AuthenticationStatementType } - * {@link SubjectStatementAbstractType } - * {@link AttributeStatementType } * * */ diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeDesignatorType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeDesignatorType.java index f96815d8..12bd8738 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeDesignatorType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeDesignatorType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeStatementType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeStatementType.java index 71faeffb..f710b74b 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeStatementType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeStatementType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeType.java index 68e41ab4..31d258a9 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AttributeType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // @@ -44,7 +44,7 @@ public class AttributeType { @XmlElement(name = "AttributeValue", required = true) - protected List attributeValue; + protected List attributeValue; /** * Gets the value of the attributeValue property. @@ -64,13 +64,13 @@ public class AttributeType * *

* Objects of the following type(s) are allowed in the list - * {@link Object } + * {@link AnyType } * * */ - public List getAttributeValue() { + public List getAttributeValue() { if (attributeValue == null) { - attributeValue = new ArrayList(); + attributeValue = new ArrayList(); } return this.attributeValue; } diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AudienceRestrictionConditionType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AudienceRestrictionConditionType.java index aa95892a..61091b73 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AudienceRestrictionConditionType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AudienceRestrictionConditionType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthenticationStatementType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthenticationStatementType.java index 5f22ea2d..93c24117 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthenticationStatementType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthenticationStatementType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorityBindingType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorityBindingType.java index 32ccb3f6..8663f35a 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorityBindingType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorityBindingType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorizationDecisionStatementType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorizationDecisionStatementType.java index 5678a373..b6b37c90 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorizationDecisionStatementType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/AuthorizationDecisionStatementType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionAbstractType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionAbstractType.java index 6952e51f..965bb4bd 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionAbstractType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionAbstractType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionsType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionsType.java index 8160779f..42c1e1af 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionsType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ConditionsType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/DecisionType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/DecisionType.java index 4fa36320..e5efbf0a 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/DecisionType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/DecisionType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/EvidenceType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/EvidenceType.java index a2fc049c..74f74440 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/EvidenceType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/EvidenceType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/NameIdentifierType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/NameIdentifierType.java index 1970e6f8..34fed5d2 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/NameIdentifierType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/NameIdentifierType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ObjectFactory.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ObjectFactory.java index fe0982ef..d5165b71 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ObjectFactory.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/ObjectFactory.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // @@ -64,43 +64,43 @@ public class ObjectFactory { } /** - * Create an instance of {@link AuthorityBindingType } + * Create an instance of {@link AnyType } * */ - public AuthorityBindingType createAuthorityBindingType() { - return new AuthorityBindingType(); + public AnyType createAnyType() { + return new AnyType(); } /** - * Create an instance of {@link AttributeDesignatorType } + * Create an instance of {@link ActionType } * */ - public AttributeDesignatorType createAttributeDesignatorType() { - return new AttributeDesignatorType(); + public ActionType createActionType() { + return new ActionType(); } /** - * Create an instance of {@link AuthenticationStatementType } + * Create an instance of {@link AttributeDesignatorType } * */ - public AuthenticationStatementType createAuthenticationStatementType() { - return new AuthenticationStatementType(); + public AttributeDesignatorType createAttributeDesignatorType() { + return new AttributeDesignatorType(); } /** - * Create an instance of {@link EvidenceType } + * Create an instance of {@link SubjectConfirmationType } * */ - public EvidenceType createEvidenceType() { - return new EvidenceType(); + public SubjectConfirmationType createSubjectConfirmationType() { + return new SubjectConfirmationType(); } /** - * Create an instance of {@link SubjectConfirmationType } + * Create an instance of {@link SubjectLocalityType } * */ - public SubjectConfirmationType createSubjectConfirmationType() { - return new SubjectConfirmationType(); + public SubjectLocalityType createSubjectLocalityType() { + return new SubjectLocalityType(); } /** @@ -112,11 +112,11 @@ public class ObjectFactory { } /** - * Create an instance of {@link SubjectLocalityType } + * Create an instance of {@link AuthenticationStatementType } * */ - public SubjectLocalityType createSubjectLocalityType() { - return new SubjectLocalityType(); + public AuthenticationStatementType createAuthenticationStatementType() { + return new AuthenticationStatementType(); } /** @@ -128,67 +128,75 @@ public class ObjectFactory { } /** - * Create an instance of {@link ActionType } + * Create an instance of {@link AuthorityBindingType } * */ - public ActionType createActionType() { - return new ActionType(); + public AuthorityBindingType createAuthorityBindingType() { + return new AuthorityBindingType(); } /** - * Create an instance of {@link AttributeStatementType } + * Create an instance of {@link AttributeType } * */ - public AttributeStatementType createAttributeStatementType() { - return new AttributeStatementType(); + public AttributeType createAttributeType() { + return new AttributeType(); } /** - * Create an instance of {@link NameIdentifierType } + * Create an instance of {@link AdviceType } * */ - public NameIdentifierType createNameIdentifierType() { - return new NameIdentifierType(); + public AdviceType createAdviceType() { + return new AdviceType(); } /** - * Create an instance of {@link AuthorizationDecisionStatementType } + * Create an instance of {@link EvidenceType } * */ - public AuthorizationDecisionStatementType createAuthorizationDecisionStatementType() { - return new AuthorizationDecisionStatementType(); + public EvidenceType createEvidenceType() { + return new EvidenceType(); } /** - * Create an instance of {@link AttributeType } + * Create an instance of {@link ConditionsType } * */ - public AttributeType createAttributeType() { - return new AttributeType(); + public ConditionsType createConditionsType() { + return new ConditionsType(); } /** - * Create an instance of {@link SubjectType } + * Create an instance of {@link AttributeStatementType } * */ - public SubjectType createSubjectType() { - return new SubjectType(); + public AttributeStatementType createAttributeStatementType() { + return new AttributeStatementType(); } /** - * Create an instance of {@link AdviceType } + * Create an instance of {@link NameIdentifierType } * */ - public AdviceType createAdviceType() { - return new AdviceType(); + public NameIdentifierType createNameIdentifierType() { + return new NameIdentifierType(); } /** - * Create an instance of {@link ConditionsType } + * Create an instance of {@link AuthorizationDecisionStatementType } * */ - public ConditionsType createConditionsType() { - return new ConditionsType(); + public AuthorizationDecisionStatementType createAuthorizationDecisionStatementType() { + return new AuthorizationDecisionStatementType(); + } + + /** + * Create an instance of {@link SubjectType } + * + */ + public SubjectType createSubjectType() { + return new SubjectType(); } /** @@ -363,12 +371,12 @@ public class ObjectFactory { } /** - * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link AnyType }{@code >}} * */ @XmlElementDecl(namespace = "urn:oasis:names:tc:SAML:1.0:assertion", name = "SubjectConfirmationData") - public JAXBElement createSubjectConfirmationData(Object value) { - return new JAXBElement(_SubjectConfirmationData_QNAME, Object.class, null, value); + public JAXBElement createSubjectConfirmationData(AnyType value) { + return new JAXBElement(_SubjectConfirmationData_QNAME, AnyType.class, null, value); } /** @@ -399,12 +407,12 @@ public class ObjectFactory { } /** - * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link AnyType }{@code >}} * */ @XmlElementDecl(namespace = "urn:oasis:names:tc:SAML:1.0:assertion", name = "AttributeValue") - public JAXBElement createAttributeValue(Object value) { - return new JAXBElement(_AttributeValue_QNAME, Object.class, null, value); + public JAXBElement createAttributeValue(AnyType value) { + return new JAXBElement(_AttributeValue_QNAME, AnyType.class, null, value); } } diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/StatementAbstractType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/StatementAbstractType.java index efe8faae..eabd815f 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/StatementAbstractType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/StatementAbstractType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectConfirmationType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectConfirmationType.java index 094e8840..d7bd8856 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectConfirmationType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectConfirmationType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // @@ -51,7 +51,7 @@ public class SubjectConfirmationType { @XmlSchemaType(name = "anyURI") protected List confirmationMethod; @XmlElement(name = "SubjectConfirmationData") - protected Object subjectConfirmationData; + protected AnyType subjectConfirmationData; @XmlElement(name = "KeyInfo", namespace = "http://www.w3.org/2000/09/xmldsig#") protected KeyInfoType keyInfo; @@ -89,10 +89,10 @@ public class SubjectConfirmationType { * * @return * possible object is - * {@link Object } + * {@link AnyType } * */ - public Object getSubjectConfirmationData() { + public AnyType getSubjectConfirmationData() { return subjectConfirmationData; } @@ -101,10 +101,10 @@ public class SubjectConfirmationType { * * @param value * allowed object is - * {@link Object } + * {@link AnyType } * */ - public void setSubjectConfirmationData(Object value) { + public void setSubjectConfirmationData(AnyType value) { this.subjectConfirmationData = value; } diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectLocalityType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectLocalityType.java index 8c59d4ae..1515d535 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectLocalityType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectLocalityType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectStatementAbstractType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectStatementAbstractType.java index 38e9bcbd..07916c14 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectStatementAbstractType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectStatementAbstractType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectType.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectType.java index 453713a1..646339c8 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectType.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/SubjectType.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // diff --git a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/package-info.java b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/package-info.java index 9de42741..4eb7ece2 100644 --- a/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/package-info.java +++ b/utils/src/main/java/oasis/names/tc/saml/_1_0/assertion/package-info.java @@ -1,8 +1,8 @@ // -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-661 // See http://java.sun.com/xml/jaxb // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2008.10.29 at 09:14:07 AM GMT +// Generated on: 2008.12.23 at 03:26:53 PM GMT // @javax.xml.bind.annotation.XmlSchema(namespace = "urn:oasis:names:tc:SAML:1.0:assertion", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) diff --git a/utils/src/test/java/saml/KeyValueAttributeTypeTest.java b/utils/src/test/java/saml/KeyValueAttributeTypeTest.java new file mode 100644 index 00000000..2df04ce6 --- /dev/null +++ b/utils/src/test/java/saml/KeyValueAttributeTypeTest.java @@ -0,0 +1,129 @@ +/* + * Copyright 2008 Federal Chancellery Austria and + * Graz University of Technology + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package saml; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.util.List; +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.namespace.QName; +import oasis.names.tc.saml._1_0.assertion.AnyType; +import oasis.names.tc.saml._1_0.assertion.AssertionType; +import oasis.names.tc.saml._1_0.assertion.AttributeStatementType; +import oasis.names.tc.saml._1_0.assertion.AttributeType; +import oasis.names.tc.saml._1_0.assertion.NameIdentifierType; +import oasis.names.tc.saml._1_0.assertion.ObjectFactory; +import oasis.names.tc.saml._1_0.assertion.StatementAbstractType; +import oasis.names.tc.saml._1_0.assertion.SubjectType; +import org.junit.Ignore; +import org.junit.Test; +import org.w3._2000._09.xmldsig_.KeyValueType; +import org.w3._2000._09.xmldsig_.RSAKeyValueType; +import org.w3c.dom.Element; + +/** + * + * @author Clemens Orthacker + */ +@Ignore +public class KeyValueAttributeTypeTest { + + @Test + public void testAttrStatement() throws FileNotFoundException, JAXBException { + JAXBContext ctx = JAXBContext.newInstance(ObjectFactory.class, org.w3._2000._09.xmldsig_.ObjectFactory.class); + Unmarshaller um = ctx.createUnmarshaller(); + + JAXBElement assertion = (JAXBElement) um.unmarshal(new File("/home/clemens/workspace/schema-base/src/main/schema/test/saml10.xml")); + List statements = assertion.getValue().getStatementOrSubjectStatementOrAuthenticationStatement(); + for (StatementAbstractType stmt : statements) { + if (stmt instanceof AttributeStatementType) { + System.out.println("AttributeStatement"); + List attrs = ((AttributeStatementType) stmt).getAttribute(); + for (AttributeType attr : attrs) { + List attrValue = attr.getAttributeValue(); + System.out.println(attrValue.size() + " AttributeValue(s)"); + for (AnyType attrValueT : attrValue) { + List attrValueContent = attrValueT.getContent(); + System.out.println(" AttributeValue: " + attrValueContent.size() + " child nodes"); + for (Object node : attrValueContent) { + if (node instanceof String) { + System.out.println(" - CDATA: " + node); + } else if (node instanceof Element) { + System.out.println(" - DOM Element: " + ((Element)node).getTagName()); + } else { + System.out.println(" - " + node.getClass()); + } + } + } + + } + } + } + } + + @Test + public void testAttributeStatement() throws JAXBException { + + org.w3._2000._09.xmldsig_.ObjectFactory dsOF = new org.w3._2000._09.xmldsig_.ObjectFactory(); + RSAKeyValueType rsaKeyValueType = dsOF.createRSAKeyValueType(); + rsaKeyValueType.setExponent("1234".getBytes()); + rsaKeyValueType.setModulus("5678".getBytes()); + + JAXBElement rsaKeyValue = dsOF.createRSAKeyValue(rsaKeyValueType); + + +// KeyValueType kvT = dsOF.createKeyValueType(); +// kvT.getContent().add(rsaKeyValue); +// JAXBElement kv = dsOF.createKeyValue(kvT); + + ObjectFactory saml10OF = new ObjectFactory(); + AssertionType assertionT = saml10OF.createAssertionType(); + + AttributeStatementType attrStatementT = saml10OF.createAttributeStatementType(); + NameIdentifierType nameIdT = saml10OF.createNameIdentifierType(); + nameIdT.setFormat("format"); + nameIdT.setNameQualifier("qualifier"); + nameIdT.setValue("value"); + JAXBElement subjNameId = saml10OF.createNameIdentifier(nameIdT); + SubjectType subjT = saml10OF.createSubjectType(); + subjT.getContent().add(subjNameId); + attrStatementT.setSubject(subjT); + + + AttributeType attrT = saml10OF.createAttributeType(); +// QName keyVal = new QName("testNS", "keyVal"); + attrT.setAttributeName("RSAkeyvalue"); + attrT.setAttributeNamespace("lskdfjlk"); + AnyType attrValueT = saml10OF.createAnyType(); + attrValueT.getContent().add(rsaKeyValue); + attrT.getAttributeValue().add(attrValueT); //kv); //keyValue); //new JAXBElement(keyVal, declaredType, attrT)) + attrStatementT.getAttribute().add(attrT); + assertionT.getStatementOrSubjectStatementOrAuthenticationStatement().add(attrStatementT); + JAXBElement assertion = saml10OF.createAssertion(assertionT); + + JAXBContext ctx = JAXBContext.newInstance(saml10OF.getClass()); + Marshaller m = ctx.createMarshaller(); + m.marshal(assertion, System.out); + } +} -- cgit v1.2.3