From f10baaa115823b8e0d2e6a736559467335a096df Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 10 Dec 2013 18:59:10 +0100 Subject: stork OA config persisted --- .../src/main/resources/config/moaid_config_2.0.xsd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index 481f12091..7df6bad3f 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -528,7 +528,7 @@ - + @@ -917,6 +917,13 @@ + + + + + + + -- cgit v1.2.3 From 7315bd2e79fe16cf13059408489050ca3450e578 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 5 Dec 2013 12:13:39 +0100 Subject: reactivated stork in default login template --- id/server/auth/src/main/webapp/info_stork.html | 4 +- .../resources/templates/loginFormFull.html | 51 +++++++++------------- 2 files changed, 21 insertions(+), 34 deletions(-) (limited to 'id/server') diff --git a/id/server/auth/src/main/webapp/info_stork.html b/id/server/auth/src/main/webapp/info_stork.html index 3bd88300c..2bdf62711 100644 --- a/id/server/auth/src/main/webapp/info_stork.html +++ b/id/server/auth/src/main/webapp/info_stork.html @@ -28,16 +28,14 @@
-

Information using STORK for secure authentication

The STORK project makes it easier for citizens to access online public services across borders by implementing Europe-wide interoperable cross border platforms for the mutual recognition of national electronic identity (eID) between participating countries.

-

For more information, please consult the STORK website:

https://www.eid-stork.eu/ +

For more information, please consult the STORK website:

https://www.eid-stork2.eu/
-
diff --git a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html index 801a2dbf1..f25e7129a 100644 --- a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html +++ b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html @@ -424,11 +424,6 @@ text-align: right; } - #stork { - margin-bottom: 10px; - margin-top: 5px; - } - #mandateLogin { padding-bottom: 4%; padding-top: 4%; @@ -812,32 +807,26 @@ - - +
+

Home Country Selection

+

+ + + i +

+
-
+

Home Country Selection

#end + + #if($SAMLRequest)#end + + #if($SAMLResponse)#end + +

+ + + + + \ No newline at end of file -- cgit v1.2.3 From 885490d16795b5d8f45d2785aaead8b074fa2cc1 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Sun, 26 Jan 2014 16:11:31 +0100 Subject: interface adaptions for szrgw #1 --- .../moa/id/auth/AuthenticationServer.java | 48 +++++++---- .../moa/id/auth/servlet/GetForeignIDServlet.java | 2 +- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 2 +- .../moa/id/auth/stork/STORKResponseProcessor.java | 61 ++++++++++---- .../validator/parep/client/szrgw/SZRGWClient.java | 95 ++++++++-------------- 5 files changed, 112 insertions(+), 96 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 49e2cbdd5..fe23b545f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -24,7 +24,6 @@ package at.gv.egovernment.moa.id.auth; import iaik.asn1.ObjectID; -import iaik.pki.PKIException; import iaik.x509.X509Certificate; import iaik.x509.X509ExtensionInitException; @@ -32,7 +31,6 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.security.GeneralSecurityException; import java.security.NoSuchAlgorithmException; import java.security.Principal; import java.security.cert.CertificateException; @@ -60,7 +58,6 @@ import org.opensaml.common.IdentifierGenerator; import org.opensaml.common.impl.SecureRandomIdentifierGenerator; import org.opensaml.xml.util.Base64; import org.opensaml.xml.util.XMLHelper; -import org.springframework.util.xml.DomUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -123,8 +120,8 @@ import at.gv.egovernment.moa.id.storage.AssertionStorage; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; import at.gv.egovernment.moa.id.storage.DBExceptionStoreImpl; import at.gv.egovernment.moa.id.util.HTTPUtils; +import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; import at.gv.egovernment.moa.id.util.Random; -import at.gv.egovernment.moa.id.util.SSLUtils; import at.gv.egovernment.moa.id.util.client.mis.simple.MISMandate; import at.gv.egovernment.moa.logging.LogMsg; import at.gv.egovernment.moa.logging.Logger; @@ -137,7 +134,6 @@ import at.gv.egovernment.moa.util.StringUtils; import at.gv.egovernment.moa.util.XPathUtils; import at.gv.util.xsd.srzgw.CreateIdentityLinkRequest; import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; -import eu.stork.mw.messages.saml.STORKAuthnRequest; import eu.stork.peps.auth.commons.PEPSUtil; import eu.stork.peps.auth.commons.PersonalAttribute; import eu.stork.peps.auth.commons.PersonalAttributeList; @@ -1700,8 +1696,8 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @return Identity link assertion * @throws SZRGWClientException */ - public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse - getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, Element signature) throws SZRGWClientException { + + public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String citizenSignature, String represented, String representative, String mandateContent) throws SZRGWClientException { SZRGWClient client = null; @@ -1713,8 +1709,9 @@ public class AuthenticationServer implements MOAIDAuthConstants { CreateIdentityLinkRequest request = new CreateIdentityLinkRequest(); - request.setSignature(DOMUtils.serializeNode(signature).getBytes()); + request.setSignature(citizenSignature.getBytes()); + Logger.info("Starte Kommunikation mit dem Stammzahlenregister Gateway(" + connectionParameters.getUrl() + ")..."); CreateIdentityLinkResponse response = client.sentCreateIDLRequest(request , connectionParameters.getUrl()); @@ -1735,17 +1732,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { // throw new SZRGWClientException("Could not initialize SSL Factory"); // } // } - Logger.info("Starte Kommunikation mit dem Stammzahlenregister Gateway(" + connectionParameters.getUrl() + ")..."); } catch (ConfigurationException e) { Logger.warn(e); Logger.warn(MOAIDMessageProvider.getInstance().getMessage("config.12", null )); - } catch (TransformerException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); } // // create request @@ -1775,6 +1765,34 @@ public class AuthenticationServer implements MOAIDAuthConstants { } + /** + * Does the request to the SZR-GW. + * + * @param signature the signature + * @return the identity link + * @throws SZRGWClientException the sZRGW client exception + * @throws ConfigurationException the configuration exception + */ + public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse getIdentityLink(Element signature) throws SZRGWClientException, ConfigurationException { + return getIdentityLink(null, null, null, null, XMLHelper.nodeToString(signature), null, null, null); + } + + /** + * Does the request to the SZR-GW. + * + * @param PEPSIdentifier the pEPS identifier + * @param PEPSFirstname the pEPS firstname + * @param PEPSFamilyname the pEPS familyname + * @param PEPSDateOfBirth the pEPS date of birth + * @param signature XMLDSIG signature + * @return Identity link assertion + * @throws SZRGWClientException the sZRGW client exception + * @throws ConfigurationException the configuration exception + */ + public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException, ConfigurationException { + return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, signature, null, null, null); + } + /** * Starts a MOA-ID authentication process using STORK * @param req HttpServletRequest diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java index 222faec37..be307ae14 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java @@ -162,7 +162,7 @@ public class GetForeignIDServlet extends AuthServlet { } // make SZR request to the identity link - CreateIdentityLinkResponse response = AuthenticationServer.getInstance().getIdentityLink(null, null, null, null, signature); + CreateIdentityLinkResponse response = AuthenticationServer.getInstance().getIdentityLink(signature); if (response.isError()) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index 653f40670..f1ee4c181 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -178,7 +178,7 @@ public class PEPSConnectorServlet extends AuthServlet { //contact SZR Gateway IdentityLink identityLink = null; try { - identityLink = STORKResponseProcessor.connectToSZRGateway(citizenSignature, storkAssertion.getAttributeStatements().get(0).getAttributes()); + identityLink = STORKResponseProcessor.connectToSZRGateway(authnResponse.getPersonalAttributeList()); } catch (STORKException e) { Logger.error("Error connecting SZR Gateway", e); throw new MOAIDException("stork.10", null); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index e47a43c90..e2112a4d9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -40,6 +40,7 @@ import at.gv.egovernment.moa.util.Constants; import at.gv.egovernment.moa.util.DateTimeUtils; import at.gv.egovernment.moa.util.StringUtils; import eu.stork.mw.messages.saml.STORKResponse; +import eu.stork.peps.auth.commons.IPersonalAttributeList; import eu.stork.vidp.messages.common.STORKConstants; import eu.stork.vidp.messages.util.SAMLUtil; import eu.stork.vidp.messages.util.XMLUtil; @@ -294,29 +295,41 @@ public class STORKResponseProcessor { } - + + /** + * helper for reading attributes. Handles logging and error handling. + * + * @param attributeName the attribute name + * @param attributeList the attribute list + * @return the attribute value + * @throws STORKException the sTORK exception + */ + private static String getAttributeValue(String attributeName, IPersonalAttributeList attributeList) throws STORKException { + try { + String result = attributeList.get(attributeName).getValue().get(0); + Logger.trace(attributeName + " : " + result); + return result; + } catch(NullPointerException e) { + Logger.error(attributeName + " not found in response"); + throw new STORKException(attributeName + " not found in response"); + } + } + /** * Handels connection to SZR-GW and returns Identity Link on success - * @param citizenSignature Citizen signature - * @param attributeList Received attribute List in assertion + * @param iPersonalAttributeList Received attribute List in assertion * @return Identity Link * @throws STORKException */ - public static IdentityLink connectToSZRGateway(Element citizenSignature, List attributeList) throws STORKException { + public static IdentityLink connectToSZRGateway(IPersonalAttributeList attributeList) throws STORKException { Logger.trace("Calling SZR Gateway with the following attributes:"); - String eIdentifier = SAMLUtil.getAttributeStringValue(attributeList, STORKConstants.STORK_ATTRIBUTE_FISCALNUMBER); - Logger.trace(STORKConstants.STORK_ATTRIBUTE_EIDENTIFIER + " : " + eIdentifier); - - String givenName = SAMLUtil.getAttributeStringValue(attributeList, STORKConstants.STORK_ATTRIBUTE_GIVENNAME); - Logger.trace(STORKConstants.STORK_ATTRIBUTE_GIVENNAME+ " : " + givenName); - - String lastName = SAMLUtil.getAttributeStringValue(attributeList, STORKConstants.STORK_ATTRIBUTE_SURNAME); - Logger.trace(STORKConstants.STORK_ATTRIBUTE_SURNAME+ " : " + lastName); - - String dateOfBirth = SAMLUtil.getAttributeStringValue(attributeList, STORKConstants.STORK_ATTRIBUTE_DATEOFBIRTH); - Logger.trace(STORKConstants.STORK_ATTRIBUTE_DATEOFBIRTH + " : " + dateOfBirth); - + // fetch mandatory attributes + String citizenSignature = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_SIGNEDDOC, attributeList); + String eIdentifier = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_EIDENTIFIER, attributeList); + String givenName = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_GIVENNAME, attributeList); + String lastName = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_SURNAME, attributeList); + String dateOfBirth = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_DATEOFBIRTH, attributeList); if (!StringUtils.isEmpty(dateOfBirth)) { dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); } @@ -325,7 +338,21 @@ public class STORKResponseProcessor { IdentityLink identityLink = null; try { Logger.trace("Starting call..."); - response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature); + + // do we have a case of representation? + try { + String representative = getAttributeValue("representative", attributeList); + String represented = getAttributeValue("represented", attributeList); + String mandate = getAttributeValue("mandateContent", attributeList); + + // if we get here we have a representation case + response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate); + + } catch(STORKException e) { + // we do not have a representation case + response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature); + } + if (response.isError()) { Logger.error("Receveid ErrorResponse from SZR Gateway."); throw new SZRGWClientException(response.getError()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/parep/client/szrgw/SZRGWClient.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/parep/client/szrgw/SZRGWClient.java index e3457f4de..325bf25a0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/parep/client/szrgw/SZRGWClient.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/parep/client/szrgw/SZRGWClient.java @@ -39,7 +39,6 @@ import org.apache.commons.httpclient.protocol.Protocol; import org.apache.xpath.XPathAPI; import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.w3c.dom.Text; @@ -254,8 +253,8 @@ public class SZRGWClient { } } - - public Document buildGetIdentityLinkRequest(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, Element signature) throws SZRGWClientException { + + public Document buildGetIdentityLinkRequest(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature, String representative, String represented, String mandateContent) throws SZRGWClientException { String SZRGW_NS = "http://reference.e-government.gv.at/namespace/szrgw/20070807#"; try { @@ -299,73 +298,25 @@ public class SZRGWClient { Text text= doc.createTextNode(PEPSDateOfBirth); elem.appendChild(text); } - } - - if (signature == null) - throw new SZRGWClientException("Signature element must not be null!"); - else { - Element sig = doc.createElementNS(SZRGW_NS, "szrgw:Signature"); - Element xmlcontent = doc.createElementNS(SZRGW_NS, "szrgw:XMLContent"); - sig.appendChild(xmlcontent); - Node n = doc.importNode(signature, true); - getIdentityLink.appendChild(sig); - xmlcontent.appendChild(n); - } - - - return doc; - } catch (ParserConfigurationException e) { - throw new SZRGWClientException(e); - } /*catch (CertificateEncodingException e) { - throw new SZRGWClientException(e); - }*/ - - } - - public Document buildGetIdentityLinkRequest(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException { - - String SZRGW_NS = "http://reference.e-government.gv.at/namespace/szrgw/20070807#"; - - try { - DocumentBuilderFactory factory =DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document doc = builder.newDocument(); - - Element getIdentityLink = doc.createElementNS(SZRGW_NS, "szrgw:GetIdentityLinkRequest"); - getIdentityLink.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:szrgw", SZRGW_NS); - doc.appendChild(getIdentityLink); - - if ( (PEPSIdentifier != null) || (PEPSFirstname != null) || (PEPSFamilyname != null) || (PEPSDateOfBirth != null) ) { - - Element pepsDataElem = doc.createElementNS(SZRGW_NS, "szrgw:PEPSData"); - getIdentityLink.appendChild(pepsDataElem); - - if (PEPSIdentifier != null) { - Element elem = doc.createElementNS(SZRGW_NS, "szrgw:Identifier"); - pepsDataElem.appendChild(elem); - Text text= doc.createTextNode(PEPSIdentifier); - elem.appendChild(text); - } - if (PEPSFirstname != null) { - Element elem = doc.createElementNS(SZRGW_NS, "szrgw:Firstname"); + if (representative != null) { + Element elem = doc.createElementNS(SZRGW_NS, "szrgw:Representative"); pepsDataElem.appendChild(elem); - Text text= doc.createTextNode(PEPSFirstname); + Text text= doc.createTextNode(representative); elem.appendChild(text); - } + } - if (PEPSFamilyname != null) { - Element elem = doc.createElementNS(SZRGW_NS, "szrgw:Familyname"); + if (represented != null) { + Element elem = doc.createElementNS(SZRGW_NS, "szrgw:Represented"); pepsDataElem.appendChild(elem); - Text text= doc.createTextNode(PEPSFamilyname); + Text text= doc.createTextNode(represented); elem.appendChild(text); } - if (PEPSDateOfBirth != null) { - Element elem = doc.createElementNS(SZRGW_NS, "szrgw:DateOfBirth"); + if (mandateContent != null) { + Element elem = doc.createElementNS(SZRGW_NS, "szrgw:MandateContent"); pepsDataElem.appendChild(elem); - Text text= doc.createTextNode(PEPSDateOfBirth); + Text text= doc.createTextNode(mandateContent); elem.appendChild(text); } } @@ -380,7 +331,27 @@ public class SZRGWClient { Text text= doc.createTextNode(signature); base64content.appendChild(text); } - + + if(representative != null && represented != null && mandateContent != null) { + Element mis = doc.createElementNS(SZRGW_NS, "szrgw:MIS"); + Element filters = doc.createElementNS(SZRGW_NS, "szrgw:Filters"); + mis.appendChild(filters); + Element target = doc.createElementNS(SZRGW_NS, "szrgw:Target"); + mis.appendChild(target); + Element friendlyName = doc.createElementNS(SZRGW_NS, "szrgw:OAFriendlyName"); + mis.appendChild(friendlyName); + getIdentityLink.appendChild(mis); + +// TODO fetch data from oa params +// String moasessionid = req.getParameter(MOAIDAuthConstants.PARAM_SESSIONID); +// moasessionid = StringEscapeUtils.escapeHtml(moasessionid); +// AuthenticationSession moasession = AuthenticationSessionStoreage.getSession(moasessionid); +// OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix()); +// if (oaParam == null) +// throw new AuthenticationException("auth.00", new Object[] { moasession.getPublicOAURLPrefix() }); +// Text text = doc.createTextNode(oaParam.getFriendlyName()); + } + return doc; } catch (ParserConfigurationException e) { throw new SZRGWClientException(e); -- cgit v1.2.3 From ef85e5437f8d228978c1eaf9311aa97a292da4fa Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Sun, 26 Jan 2014 16:54:33 +0100 Subject: moved XMLUtil to more reasonable place --- .../moa/id/auth/AuthenticationServer.java | 3 +- .../auth/stork/PEPSConnectorResponseVerifier.java | 2 +- .../moa/id/auth/stork/STORKResponseProcessor.java | 3 +- .../id/config/legacy/BuildFromLegacyConfig.java | 2 +- .../moa/id/config/stork/STORKConfig.java | 2 - .../pvp2x/verification/SAMLVerifierMOASP.java | 2 +- .../at/gv/egovernment/moa/id/util/XMLUtil.java | 143 +++++++++++++++++++++ .../java/eu/stork/vidp/messages/util/XMLUtil.java | 143 --------------------- 8 files changed, 150 insertions(+), 150 deletions(-) create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/XMLUtil.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/util/XMLUtil.java (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index fe23b545f..b8a0fe678 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -122,6 +122,8 @@ import at.gv.egovernment.moa.id.storage.DBExceptionStoreImpl; import at.gv.egovernment.moa.id.util.HTTPUtils; import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; import at.gv.egovernment.moa.id.util.Random; +import at.gv.egovernment.moa.id.util.SSLUtils; +import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.id.util.client.mis.simple.MISMandate; import at.gv.egovernment.moa.logging.LogMsg; import at.gv.egovernment.moa.logging.Logger; @@ -140,7 +142,6 @@ import eu.stork.peps.auth.commons.PersonalAttributeList; import eu.stork.peps.auth.commons.STORKAuthnRequest; import eu.stork.peps.auth.engine.STORKSAMLEngine; import eu.stork.peps.exceptions.STORKSAMLEngineException; -import eu.stork.vidp.messages.util.XMLUtil; /** * API for MOA ID Authentication Service.
{@link AuthenticationSession} is diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/PEPSConnectorResponseVerifier.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/PEPSConnectorResponseVerifier.java index f78067b5f..b3a707134 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/PEPSConnectorResponseVerifier.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/PEPSConnectorResponseVerifier.java @@ -40,11 +40,11 @@ import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; import at.gv.egovernment.moa.id.auth.parser.VerifyXMLSignatureResponseParser; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.logging.Logger; import eu.stork.mw.messages.saml.STORKResponse; import eu.stork.vidp.messages.exception.SAMLValidationException; import eu.stork.vidp.messages.util.SAMLUtil; -import eu.stork.vidp.messages.util.XMLUtil; /** * Verifies the SMAL response according to the STORK specification diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index e2112a4d9..ab62c2718 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -35,6 +35,8 @@ import at.gv.egovernment.moa.id.auth.exception.ParseException; import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse; import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.SZRGWClientException; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Constants; import at.gv.egovernment.moa.util.DateTimeUtils; @@ -43,7 +45,6 @@ import eu.stork.mw.messages.saml.STORKResponse; import eu.stork.peps.auth.commons.IPersonalAttributeList; import eu.stork.vidp.messages.common.STORKConstants; import eu.stork.vidp.messages.util.SAMLUtil; -import eu.stork.vidp.messages.util.XMLUtil; /** * diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java index 7ef043abe..407e7da52 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java @@ -18,7 +18,6 @@ import org.opensaml.saml2.metadata.RequestedAttribute; import org.w3c.dom.Element; import eu.stork.vidp.messages.util.SAMLUtil; -import eu.stork.vidp.messages.util.XMLUtil; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; @@ -67,6 +66,7 @@ import at.gv.egovernment.moa.id.config.ConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.data.IssuerAndSerial; +import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Base64Utils; import at.gv.egovernment.moa.util.DOMUtils; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java index e388b39e7..24c7ad264 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java @@ -20,8 +20,6 @@ import org.w3c.dom.Element; import org.xml.sax.SAXException; import eu.stork.vidp.messages.util.SAMLUtil; -import eu.stork.vidp.messages.util.XMLUtil; - import at.gv.egovernment.moa.id.commons.db.dao.config.SAMLSigningParameter; import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; import at.gv.egovernment.moa.id.commons.db.dao.config.SignatureVerificationParameterType; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/SAMLVerifierMOASP.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/SAMLVerifierMOASP.java index c744abdf5..495f5f0db 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/SAMLVerifierMOASP.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/SAMLVerifierMOASP.java @@ -15,8 +15,8 @@ import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; import at.gv.egovernment.moa.id.auth.parser.VerifyXMLSignatureResponseParser; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.logging.Logger; -import eu.stork.vidp.messages.util.XMLUtil; public class SAMLVerifierMOASP implements ISAMLVerifier { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/XMLUtil.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/XMLUtil.java new file mode 100644 index 000000000..d87d510fa --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/XMLUtil.java @@ -0,0 +1,143 @@ +/** + * + */ +package at.gv.egovernment.moa.id.util; + +import java.io.File; +import java.io.IOException; +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.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Helper class for XML processing + * @author bzwattendorfer + * + */ +public class XMLUtil { + + /** + * Transforms a string representation to a DOM representation + * @param xmlString XML as string + * @return DOM representation of String + * @throws ParserConfigurationException + * @throws SAXException + * @throws IOException + */ + public static Element stringToDOM(String xmlString) throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + + DocumentBuilder builder = dbf.newDocumentBuilder(); + + Reader reader = new StringReader(xmlString); + InputSource src = new InputSource(reader); + Document domDoc = builder.parse(src); + return domDoc.getDocumentElement(); + } + + /** + * Creates a new and empty XML document + * @return New XML document + * @throws ParserConfigurationException + */ + public static Document createNewDocument() throws ParserConfigurationException { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + + DocumentBuilder builder = dbf.newDocumentBuilder(); + return builder.newDocument(); + } + + /** + * Transforms an XML to a String + * @param node XML node + * @return String represenation of XML + */ + public static String printXML(Node node) { + TransformerFactory tfactory = TransformerFactory.newInstance(); + Transformer serializer; + try { + serializer = tfactory.newTransformer(); + + serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + serializer.setOutputProperty(OutputKeys.ENCODING,"UTF-8"); + + StringWriter output = new StringWriter(); + serializer.transform(new DOMSource(node), new StreamResult(output)); + return output.toString(); + } catch (TransformerException e) { + + throw new RuntimeException(e); + } + } + + /** + * Writes an XML element to a given file + * @param doc XML element + * @param filename Filename of the file where to write XML + */ + public static void writeXmlFile(Element doc, String filename) { + try { + + Source source = new DOMSource(doc); + File file = new File(filename); + Result result = new StreamResult(file); + + Transformer xformer = TransformerFactory.newInstance().newTransformer(); + xformer.transform(source, result); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * Gets the first text value of a NodeList + * @param nList NodeList + * @return first text value of a NodeList + */ + public static String getFirstTextValueFromNodeList(NodeList nList) { + if (nList != null && nList.getLength() != 0) { + return nList.item(0).getTextContent(); + } + return null; + } + + /** + * Gets the first element of a Node + * @param parent Node + * @return first element of a Node + */ + public static Element getFirstElement(Node parent) { + Node n = parent.getFirstChild(); + while (n != null && n.getNodeType() != Node.ELEMENT_NODE) { + n = n.getNextSibling(); + } + if (n == null) { + return null; + } + return (Element)n; + } + + + +} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/util/XMLUtil.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/util/XMLUtil.java deleted file mode 100644 index 3ca38ec03..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/util/XMLUtil.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * - */ -package eu.stork.vidp.messages.util; - -import java.io.File; -import java.io.IOException; -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.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Helper class for XML processing - * @author bzwattendorfer - * - */ -public class XMLUtil { - - /** - * Transforms a string representation to a DOM representation - * @param xmlString XML as string - * @return DOM representation of String - * @throws ParserConfigurationException - * @throws SAXException - * @throws IOException - */ - public static Element stringToDOM(String xmlString) throws ParserConfigurationException, SAXException, IOException { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - - DocumentBuilder builder = dbf.newDocumentBuilder(); - - Reader reader = new StringReader(xmlString); - InputSource src = new InputSource(reader); - Document domDoc = builder.parse(src); - return domDoc.getDocumentElement(); - } - - /** - * Creates a new and empty XML document - * @return New XML document - * @throws ParserConfigurationException - */ - public static Document createNewDocument() throws ParserConfigurationException { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setNamespaceAware(true); - - DocumentBuilder builder = dbf.newDocumentBuilder(); - return builder.newDocument(); - } - - /** - * Transforms an XML to a String - * @param node XML node - * @return String represenation of XML - */ - public static String printXML(Node node) { - TransformerFactory tfactory = TransformerFactory.newInstance(); - Transformer serializer; - try { - serializer = tfactory.newTransformer(); - - serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); - serializer.setOutputProperty(OutputKeys.ENCODING,"UTF-8"); - - StringWriter output = new StringWriter(); - serializer.transform(new DOMSource(node), new StreamResult(output)); - return output.toString(); - } catch (TransformerException e) { - - throw new RuntimeException(e); - } - } - - /** - * Writes an XML element to a given file - * @param doc XML element - * @param filename Filename of the file where to write XML - */ - public static void writeXmlFile(Element doc, String filename) { - try { - - Source source = new DOMSource(doc); - File file = new File(filename); - Result result = new StreamResult(file); - - Transformer xformer = TransformerFactory.newInstance().newTransformer(); - xformer.transform(source, result); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Gets the first text value of a NodeList - * @param nList NodeList - * @return first text value of a NodeList - */ - public static String getFirstTextValueFromNodeList(NodeList nList) { - if (nList != null && nList.getLength() != 0) { - return nList.item(0).getTextContent(); - } - return null; - } - - /** - * Gets the first element of a Node - * @param parent Node - * @return first element of a Node - */ - public static Element getFirstElement(Node parent) { - Node n = parent.getFirstChild(); - while (n != null && n.getNodeType() != Node.ELEMENT_NODE) { - n = n.getNextSibling(); - } - if (n == null) { - return null; - } - return (Element)n; - } - - - -} -- cgit v1.2.3 From 133f63cef5bffb06e57896a1e83383a414d932df Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Sun, 26 Jan 2014 17:01:41 +0100 Subject: attribute name handling is more samlengine like --- .../egovernment/moa/id/auth/stork/STORKResponseProcessor.java | 10 +++++----- .../src/test/resources/StorkSamlEngine_demo.xml | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index ab62c2718..b8e823de0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -326,11 +326,11 @@ public class STORKResponseProcessor { Logger.trace("Calling SZR Gateway with the following attributes:"); // fetch mandatory attributes - String citizenSignature = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_SIGNEDDOC, attributeList); - String eIdentifier = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_EIDENTIFIER, attributeList); - String givenName = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_GIVENNAME, attributeList); - String lastName = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_SURNAME, attributeList); - String dateOfBirth = getAttributeValue(STORKConstants.STORK_ATTRIBUTE_DATEOFBIRTH, attributeList); + String citizenSignature = getAttributeValue("signedDoc", attributeList); + String eIdentifier = getAttributeValue("eIdentifier", attributeList); + String givenName = getAttributeValue("givenName", attributeList); + String lastName = getAttributeValue("surname", attributeList); + String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); if (!StringUtils.isEmpty(dateOfBirth)) { dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); } diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml index 0a28a5de8..f8fc4f91a 100644 --- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml +++ b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml @@ -87,5 +87,7 @@ http://www.stork.gov.eu/1.0/newAttribute2 http://www.stork.gov.eu/1.0/hasDegree http://www.stork.gov.eu/1.0/mandateContent + http://www.stork.gov.eu/1.0/representative + http://www.stork.gov.eu/1.0/represented \ No newline at end of file -- cgit v1.2.3 From 1ff6044b66a717edff42bd3a1c19a044e744c3b3 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Sun, 26 Jan 2014 17:09:46 +0100 Subject: cleanup --- .../moa/id/config/stork/STORKConfig.java | 51 ---------------------- 1 file changed, 51 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java index 24c7ad264..3282b8737 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java @@ -3,7 +3,6 @@ */ package at.gv.egovernment.moa.id.config.stork; -import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; @@ -12,17 +11,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; -import javax.xml.parsers.ParserConfigurationException; - -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.ws.message.encoder.MessageEncodingException; -import org.w3c.dom.Element; -import org.xml.sax.SAXException; - -import eu.stork.vidp.messages.util.SAMLUtil; -import at.gv.egovernment.moa.id.commons.db.dao.config.SAMLSigningParameter; import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; -import at.gv.egovernment.moa.id.commons.db.dao.config.SignatureVerificationParameterType; import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.StringUtils; @@ -57,54 +46,14 @@ public class STORKConfig { try { CPEPS moacpep = new CPEPS(cpep.getCountryCode(), new URL(cpep.getURL())); - - -// List attr = cpep.getAttributeValue(); -// -// ArrayList requestedAttributes = new ArrayList(); -// -// for (String e1 : attr) { -// Element element = XMLUtil.stringToDOM(e1); -// RequestedAttribute requestedAttribute = (RequestedAttribute) SAMLUtil.unmarshallMessage(element); -// requestedAttributes.add(requestedAttribute); -// } -// moacpep.setCountrySpecificRequestedAttributes(requestedAttributes); - cpepsMap.put(cpep.getCountryCode(), moacpep); } catch (MalformedURLException e) { Logger.warn("Error in MOA-ID Configuration. CPEP entry for country " + cpep.getCountryCode() + " has an invalid URL and is ignored."); -// } catch (ParserConfigurationException e) { -// Logger.warn("Error in MOA-ID Configuration. CPEP entry for country " -// + cpep.getCountryCode() + " has an invalid Attribute and is ignored."); -// } catch (SAXException e) { -// Logger.warn("Error in MOA-ID Configuration. CPEP entry for country " -// + cpep.getCountryCode() + " has an invalid Attribute and is ignored."); -// } catch (IOException e) { -// Logger.warn("Error in MOA-ID Configuration. CPEP entry for country " -// + cpep.getCountryCode() + " has an invalid Attribute and is ignored."); -// } catch (MessageEncodingException e) { -// Logger.warn("Error in MOA-ID Configuration. CPEP entry for country " -// + cpep.getCountryCode() + " has an invalid Attribute and is ignored."); } -// SAMLSigningParameter samlsign = stork.getSAMLSigningParameter(); // TODO Fix nullpointerexception when nothing is configured -// -// if (samlsign == null) { -// Logger.warn("Error in MOA-ID Configuration. No STORK->SAMLSigningParameter configuration found."); -// -// } else { -// SignatureVerificationParameterType sigverify = samlsign.getSignatureVerificationParameter(); -// -// if (sigverify == null) { -// Logger.warn("Error in MOA-ID Configuration. No STORK->SignatureVerificationParameter configuration found."); -// -// } else { -// sigverifyparam = new SignatureVerificationParameter(sigverify.getTrustProfileID()); -// } -// } attr = new ArrayList(); for(StorkAttribute current : stork.getAttributes()) { attr.add(current); -- cgit v1.2.3 From 8d18054deef38fa8a434f5049664c7219f5c9d7a Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Mon, 27 Jan 2014 10:27:20 +0100 Subject: cleaned legacy config from stork artifacts --- .../id/config/legacy/BuildFromLegacyConfig.java | 68 -------- .../moa/id/config/legacy/ConfigurationBuilder.java | 176 --------------------- .../moa/id/config/legacy/OAAuthParameter.java | 59 ------- 3 files changed, 303 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java index 407e7da52..f5fdbd90a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java @@ -14,15 +14,11 @@ import java.util.Map; import java.util.Properties; import java.util.Set; -import org.opensaml.saml2.metadata.RequestedAttribute; import org.w3c.dom.Element; -import eu.stork.vidp.messages.util.SAMLUtil; - import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS; -import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModeType; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.ConnectionParameterClientAuthType; @@ -32,8 +28,6 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; -import at.gv.egovernment.moa.id.commons.db.dao.config.KeyName; -import at.gv.egovernment.moa.id.commons.db.dao.config.KeyStore; import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector; @@ -47,13 +41,9 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineMandates; import at.gv.egovernment.moa.id.commons.db.dao.config.Organization; import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; import at.gv.egovernment.moa.id.commons.db.dao.config.Protocols; -import at.gv.egovernment.moa.id.commons.db.dao.config.SAMLSigningParameter; import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; import at.gv.egovernment.moa.id.commons.db.dao.config.SSO; -import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; import at.gv.egovernment.moa.id.commons.db.dao.config.SecurityLayer; -import at.gv.egovernment.moa.id.commons.db.dao.config.SignatureCreationParameterType; -import at.gv.egovernment.moa.id.commons.db.dao.config.SignatureVerificationParameterType; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType; import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; @@ -66,7 +56,6 @@ import at.gv.egovernment.moa.id.config.ConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.data.IssuerAndSerial; -import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Base64Utils; import at.gv.egovernment.moa.util.DOMUtils; @@ -283,63 +272,6 @@ public class BuildFromLegacyConfig { parseConnectionParameterClientAuth(foreignIDConnectionParameter); auth_foreign.setConnectionParameter(auth_foreign_connection); - //set STORK configuration - STORKConfig storkConfig = new STORKConfig(builder.buildSTORKSignatureCreationParameter(),builder.buildSTORKSignatureVerificationParameter(), builder.buildSTORKcPEPSMap()); - STORK auth_foreign_stork = new STORK(); - auth_foreign.setSTORK(auth_foreign_stork); - - //set CPEPS - Map map = storkConfig.getCpepsMap(); - Set map_keys = map.keySet(); - List auth_foreign_stork_cpeps = new ArrayList(); - for (String key : map_keys) { - CPEPS cpep = new CPEPS(); - cpep.setCountryCode(map.get(key).getCountryCode()); - cpep.setURL(map.get(key).getPepsURL().toExternalForm()); //check correctness!!!! - - List cpep_reqs = new ArrayList(); - - List map1 = map.get(key).getCountrySpecificRequestedAttributes(); - for (RequestedAttribute e1 : map1) { - Element element = SAMLUtil.marshallMessage(e1); - cpep_reqs.add(XMLUtil.printXML(element)); - } - cpep.setAttributeValue(cpep_reqs); - auth_foreign_stork_cpeps.add(cpep); - } - auth_foreign_stork.setCPEPS(auth_foreign_stork_cpeps); - - - //set SAMLSigningParameter - if (storkConfig.getSignatureCreationParameter() != null && - storkConfig.getSignatureVerificationParameter() != null) { - SAMLSigningParameter auth_foreign_stork_samlSign = new SAMLSigningParameter(); - auth_foreign_stork.setSAMLSigningParameter(auth_foreign_stork_samlSign); - - SignatureCreationParameterType stork_saml_creat = new SignatureCreationParameterType(); - auth_foreign_stork_samlSign.setSignatureCreationParameter(stork_saml_creat); - KeyStore stork_saml_creat_keystore = new KeyStore(); - stork_saml_creat.setKeyStore(stork_saml_creat_keystore); - stork_saml_creat_keystore.setPassword(storkConfig.getSignatureCreationParameter().getKeyStorePassword()); - stork_saml_creat_keystore.setValue(storkConfig.getSignatureCreationParameter().getKeyStorePath()); - KeyName stork_saml_creat_keyname = new KeyName(); - stork_saml_creat.setKeyName(stork_saml_creat_keyname); - stork_saml_creat_keyname.setValue(storkConfig.getSignatureCreationParameter().getKeyName()); - stork_saml_creat_keyname.setPassword(storkConfig.getSignatureCreationParameter().getKeyPassword()); - - - - SignatureVerificationParameterType stork_saml_verify = new SignatureVerificationParameterType(); - auth_foreign_stork_samlSign.setSignatureVerificationParameter(stork_saml_verify); - stork_saml_verify.setTrustProfileID(storkConfig.getSignatureVerificationParameter().getTrustProfileID()); - - } - - //TODO: check correctness - //set QualityAuthenticationAssurance - //set RequestedAttbutes - - //set OnlineMandates config ConnectionParameter onlineMandatesConnectionParameter = builder.buildOnlineMandatesConnectionParameter(); if (onlineMandatesConnectionParameter != null) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java index 3abc94b02..525c5a24e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/ConfigurationBuilder.java @@ -30,8 +30,6 @@ import iaik.utils.RFC2253NameParserException; import java.io.IOException; import java.math.BigInteger; -import java.net.MalformedURLException; -import java.net.URL; import java.security.Principal; import java.util.ArrayList; import java.util.HashMap; @@ -41,8 +39,6 @@ import java.util.List; import java.util.Map; import java.util.Vector; -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.ws.message.encoder.MessageEncodingException; import org.w3c.dom.Attr; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -56,9 +52,7 @@ import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.legacy.OAAuthParameter; import at.gv.egovernment.moa.id.config.legacy.VerifyInfoboxParameter; import at.gv.egovernment.moa.id.config.legacy.VerifyInfoboxParameters; -import at.gv.egovernment.moa.id.config.legacy.CPEPS; import at.gv.egovernment.moa.id.config.legacy.SignatureCreationParameter; -import at.gv.egovernment.moa.id.config.legacy.SignatureVerificationParameter; import at.gv.egovernment.moa.id.data.IssuerAndSerial; import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; import at.gv.egovernment.moa.logging.Logger; @@ -66,15 +60,9 @@ import at.gv.egovernment.moa.util.BoolUtils; import at.gv.egovernment.moa.util.Constants; import at.gv.egovernment.moa.util.DOMUtils; import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.MiscUtil; import at.gv.egovernment.moa.util.StringUtils; import at.gv.egovernment.moa.util.XPathException; import at.gv.egovernment.moa.util.XPathUtils; -import eu.stork.vidp.messages.builder.STORKMessagesBuilder; -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; -import eu.stork.vidp.messages.stork.RequestedAttributes; -import eu.stork.vidp.messages.util.SAMLUtil; /** * A class that builds configuration data from a DOM based representation. @@ -1218,170 +1206,6 @@ public List getTrustedTemplateURLs() { } - /** - * Creates a SignatureVerificationParameter object from the MOA-ID configuration - * This configuration object contains the TrustProfile to be used for signature verification (STORK SAML Signature Verification) - * - * @return TrustProfileID for signature verification (STORK SAML Signature Verification) - */ - public SignatureVerificationParameter buildSTORKSignatureVerificationParameter() { - - Logger.debug("Loading STORK signature verification parameters."); - - Element signatureVerificationParameterElement = (Element)XPathUtils.selectSingleNode(configElem_, AUTH_FOREIGN_IDENTITIES_STORK_SIGNATURE_VERIFICATION_PARAMETER); - if (signatureVerificationParameterElement == null) { - Logger.debug("No STORK verification parameters found, " +AUTH_FOREIGN_IDENTITIES_STORK_SIGNATURE_VERIFICATION_PARAMETER + "is missing."); - return null; - } - - SignatureVerificationParameter signatureVerificationParameter = new SignatureVerificationParameter(); - - String trustProfileID = XPathUtils.getElementValue(signatureVerificationParameterElement, AUTH_FOREIGN_IDENTITIES_STORK_TRUSTPROFILE_ID, null); - if (StringUtils.isEmpty(trustProfileID)) { - Logger.error(AUTH_FOREIGN_IDENTITIES_STORK_TRUSTPROFILE_ID + "is missing."); - return null; - } - Logger.trace("Using the following MOA-SP TrustProfile for STORK SAML signature verification: " + trustProfileID); - signatureVerificationParameter.setTrustProfileID(trustProfileID); - - Logger.info("STORK signature verification parameters loaded."); - - return signatureVerificationParameter; - } - - /** - * Builds a C-PEPS object from configuration - * @param cpepsElement DOM Element of C-PEPS from configuration - * @return C-PEPS object - */ - public CPEPS buildSTORKCpeps(Element cpepsElement) { - - String countryCode = cpepsElement.getAttribute(AUTH_FOREIGN_IDENTITIES_STORK_CPEPS_COUNTRY_CODE); - String cpepsURLString = cpepsElement.getAttribute(AUTH_FOREIGN_IDENTITIES_STORK_CPEPS_URL); - if (StringUtils.isEmpty(countryCode)) { - Logger.error(AUTH_FOREIGN_IDENTITIES_STORK_CPEPS_COUNTRY_CODE + "is missing."); - return null; - } - if (StringUtils.isEmpty(cpepsURLString)) { - Logger.error(AUTH_FOREIGN_IDENTITIES_STORK_CPEPS_URL + "is missing."); - return null; - } - - URL cpepsURL; - try { - cpepsURL = new URL(cpepsURLString); - } catch (MalformedURLException e) { - Logger.error("Provided CPEPS-URL (" + cpepsURLString + ") for country " + countryCode + " is not a URL", e); - return null; - } - CPEPS cpeps = new CPEPS(countryCode, cpepsURL); - Logger.debug("Adding C-PEPS for country: " + cpeps.getCountryCode() + ", URL: " + cpeps.getPepsURL()); - - Element reqAttributeElement; - NodeIterator reqAttributeIterator = XPathUtils.selectNodeIterator(cpepsElement, AUTH_FOREIGN_IDENTITIES_STORK_CPEPS_REQUESTED_ATTRIBUTES); - - while ((reqAttributeElement = (Element) reqAttributeIterator.nextNode()) != null) { - RequestedAttribute requestedAttribute; - try { - requestedAttribute = (RequestedAttribute) SAMLUtil.unmarshallMessage(reqAttributeElement); - } catch (MessageEncodingException e) { - Logger.error("Provided RequestedAttributes for CPEPS from country " + countryCode + " is malformed.", e); - return null; - } - //only add if STORK attribute is correct - if (STORKConstants.FULL_STORK_ATTRIBUTE_SET.contains(requestedAttribute.getName())) { - cpeps.addCountrySpecificRequestedAttribute(requestedAttribute); - Logger.debug("Adding also country specific requested attribute for C-PEPS (" + countryCode + "): " + requestedAttribute.getName() + ", isRequired: " + requestedAttribute.isRequired()); - } else { - Logger.warn("Skipping addition of requested STORK Attribute, attribute unknown : " + requestedAttribute.getName()); - } - - } - - return cpeps; - } - - /** - * Builds the supported C-PEPS Map from configuration - * @return Map of C-PEPS - */ - public Map buildSTORKcPEPSMap() { - - Logger.debug("Loading STORK C-PEPS information"); - - Map cpepsMap = new HashMap(); - - NodeIterator cpepsIterator = XPathUtils.selectNodeIterator(configElem_, AUTH_FOREIGN_IDENTITIES_STORK_CPEPS); - - Element cpepsElement; - CPEPS cpeps; - - while ((cpepsElement = (Element) cpepsIterator.nextNode()) != null) { - cpeps = buildSTORKCpeps(cpepsElement); - if (cpeps != null) { - cpepsMap.put(cpeps.getCountryCode(), cpeps); - } - } - - if(!cpepsMap.isEmpty()) { - Logger.info("STORK C-PEPS information loaded"); - } - - return cpepsMap; - - } - - /** - * Builds the required STORK QAALevel for this OA - * @param authComponentElement DOM Element of AuthComponent (from MOA configuration) - * @return STORK QAALevel for this OA - */ - public QualityAuthenticationAssuranceLevel buildOaSTORKQAALevel(Element authComponentElement) { - Element qaaLevelElement = (Element)XPathUtils.selectSingleNode(authComponentElement, OA_AUTH_COMPONENT_STORK_QAA); - - if (qaaLevelElement == null) return null; - - try { - QualityAuthenticationAssuranceLevel qaaLevel = (QualityAuthenticationAssuranceLevel) SAMLUtil.unmarshallMessage(qaaLevelElement); - return qaaLevel; - } catch (MessageEncodingException e) { - Logger.error("Could not build STORK QAALevel, using default."); - return null; - } - - } - - /** - * Builds the Requested Attributes specific for an OA - * @param authComponentElement DOM Element of AuthComponent (from MOA configuration) - * @return STORK RequestedAttributes for this OA - */ - public RequestedAttributes buildOaSTORKRequestedAttributes(Element authComponentElement) { - List reqAttributeList = new ArrayList(); - - - Element reqAttributeElement; - NodeIterator reqAttributeIterator = XPathUtils.selectNodeIterator(authComponentElement, OA_AUTH_COMPONENT_STORK_REQUESTED_ATTRIBUTE); - - while ((reqAttributeElement = (Element) reqAttributeIterator.nextNode()) != null) { - RequestedAttribute requestedAttribute; - try { - requestedAttribute = (RequestedAttribute) SAMLUtil.unmarshallMessage(reqAttributeElement); - } catch (MessageEncodingException e) { - Logger.error("Provided RequestedAttributes Online Application is malformed.", e); - return null; - } - //only add if STORK attribute is correct - if (STORKConstants.FULL_STORK_ATTRIBUTE_SET.contains(requestedAttribute.getName())) { - reqAttributeList.add(requestedAttribute); - } else { - Logger.warn("Skipping addition of requested STORK Attribute, attribute unknown : " + requestedAttribute.getName()); - } - } - - return STORKMessagesBuilder.buildRequestedAttributes(reqAttributeList); - } - /** * Method warn. * @param messageId to identify a country-specific message diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/OAAuthParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/OAAuthParameter.java index 3948522c0..7174e05dc 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/OAAuthParameter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/OAAuthParameter.java @@ -24,15 +24,6 @@ package at.gv.egovernment.moa.id.config.legacy; -import java.util.ArrayList; - -import org.opensaml.saml2.metadata.RequestedAttribute; - -import eu.stork.vidp.messages.builder.STORKMessagesBuilder; -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; -import eu.stork.vidp.messages.stork.RequestedAttributes; - /** * Configuration parameters belonging to an online application, * to use with the MOA ID Auth component. @@ -129,22 +120,6 @@ public class OAAuthParameter extends OAParameter { */ private String identityLinkDomainIdentifierType; - /** - * STORK QAA Level, Default = 4 - */ - private QualityAuthenticationAssuranceLevel qaaLevel = STORKMessagesBuilder.buildQualityAuthenticationAssuranceLevel(4); - - /** - * STORK RequestedAttributes for Online Application - * Default RequestedAttributes are: eIdentifier, givenName, surname, dateOfBirth - */ - private RequestedAttributes requestedAttributes = STORKMessagesBuilder.buildRequestedAttributes( - STORKMessagesBuilder.buildRequestedAttribute(STORKConstants.STORK_ATTRIBUTE_EIDENTIFIER, true, null), - STORKMessagesBuilder.buildRequestedAttribute(STORKConstants.STORK_ATTRIBUTE_GIVENNAME, true, null), - STORKMessagesBuilder.buildRequestedAttribute(STORKConstants.STORK_ATTRIBUTE_SURNAME, true, null), - STORKMessagesBuilder.buildRequestedAttribute(STORKConstants.STORK_ATTRIBUTE_DATEOFBIRTH, false, null)); - - /** * Returns true if the Security Layer version is version 1.2, * otherwise false. @@ -464,38 +439,4 @@ public class OAAuthParameter extends OAParameter { return this.mandateProfiles; } - /** - * Returns the defined STORK QAALevel - * @return STORK QAALevel - */ - public QualityAuthenticationAssuranceLevel getQaaLevel() { - return qaaLevel; - } - - /** - * Sets the STORK QAALevel - * @param qaaLevel - */ - public void setQaaLevel(QualityAuthenticationAssuranceLevel qaaLevel) { - this.qaaLevel = qaaLevel; - } - - /** - * Returns the desired STORK Requested Attributes - * @return STORK Requested Attributes - */ - public RequestedAttributes getRequestedAttributes() { - return requestedAttributes; - } - - /** - * Sets the desired STORK Requested Attributes - * @param requestedAttributes - */ - public void setRequestedAttributes(RequestedAttributes requestedAttributes) { - this.requestedAttributes = requestedAttributes; - } - - - } -- cgit v1.2.3 From fdcc7df81a159284d6bcfcd94be28c6f08afc5e4 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Mon, 27 Jan 2014 14:09:32 +0100 Subject: fixed merge issue missing bracket --- .../src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java | 1 + 1 file changed, 1 insertion(+) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java index 3282b8737..95ed628fa 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java @@ -52,6 +52,7 @@ public class STORKConfig { Logger.warn("Error in MOA-ID Configuration. CPEP entry for country " + cpep.getCountryCode() + " has an invalid URL and is ignored."); } + } attr = new ArrayList(); -- cgit v1.2.3 From 09266016cbcb143d7b6e65d32b49b6b3d2cb53c0 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Mon, 27 Jan 2014 17:24:46 +0100 Subject: fixed issues after merge --- .../moa/id/auth/AuthenticationServer.java | 18 ++++++++++- id/server/moa-id-commons/pom.xml | 37 +++++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index b8a0fe678..9ab96a726 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -135,6 +135,7 @@ import at.gv.egovernment.moa.util.MiscUtil; import at.gv.egovernment.moa.util.StringUtils; import at.gv.egovernment.moa.util.XPathUtils; import at.gv.util.xsd.srzgw.CreateIdentityLinkRequest; +import at.gv.util.xsd.srzgw.CreateIdentityLinkRequest.PEPSData; import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; import eu.stork.peps.auth.commons.PEPSUtil; import eu.stork.peps.auth.commons.PersonalAttribute; @@ -1712,6 +1713,21 @@ public class AuthenticationServer implements MOAIDAuthConstants { CreateIdentityLinkRequest request = new CreateIdentityLinkRequest(); request.setSignature(citizenSignature.getBytes()); + PEPSData data = new PEPSData(); + data.setDateOfBirth(PEPSDateOfBirth); + data.setFamilyname(PEPSFamilyname); + data.setFirstname(PEPSFirstname); + data.setIdentifier(PEPSIdentifier); + +// TODO add mandate data +// data.setRepresentative(representative); +// data.setRepresented(represented); +// data.setMandateContent(mandateContent); + request.setPEPSData(data); + + +// request.setMIS(value) + Logger.info("Starte Kommunikation mit dem Stammzahlenregister Gateway(" + connectionParameters.getUrl() + ")..."); CreateIdentityLinkResponse response = client.sentCreateIDLRequest(request , connectionParameters.getUrl()); @@ -1790,7 +1806,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException the sZRGW client exception * @throws ConfigurationException the configuration exception */ - public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException, ConfigurationException { + public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException { return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, signature, null, null, null); } diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index c3e850b11..d80e91e31 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -190,5 +190,40 @@ - + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.jvnet.hyperjaxb3 + + + maven-hyperjaxb3-plugin + + + [0.5.6,) + + + generate + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 98137f26f5b0bd33d178e16ea5ee9397f2cc2c0a Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Mon, 27 Jan 2014 17:42:26 +0100 Subject: refactored szrgw response type --- .../moa/id/auth/AuthenticationServer.java | 6 ++--- .../moa/id/auth/servlet/GetForeignIDServlet.java | 27 ++++++++-------------- .../moa/id/auth/stork/STORKResponseProcessor.java | 24 +++++++++---------- 3 files changed, 24 insertions(+), 33 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 9ab96a726..3dc2639d5 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1699,7 +1699,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException */ - public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String citizenSignature, String represented, String representative, String mandateContent) throws SZRGWClientException { + public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String citizenSignature, String represented, String representative, String mandateContent) throws SZRGWClientException { SZRGWClient client = null; @@ -1790,7 +1790,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException the sZRGW client exception * @throws ConfigurationException the configuration exception */ - public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse getIdentityLink(Element signature) throws SZRGWClientException, ConfigurationException { + public CreateIdentityLinkResponse getIdentityLink(Element signature) throws SZRGWClientException, ConfigurationException { return getIdentityLink(null, null, null, null, XMLHelper.nodeToString(signature), null, null, null); } @@ -1806,7 +1806,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException the sZRGW client exception * @throws ConfigurationException the configuration exception */ - public at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException { + public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException { return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, signature, null, null, null); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java index be307ae14..d42cd85dc 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java @@ -24,6 +24,7 @@ package at.gv.egovernment.moa.id.auth.servlet; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.cert.CertificateException; import java.util.Map; @@ -47,14 +48,14 @@ import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; -import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse; -import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.SZRGWClientException; +import at.gv.egovernment.moa.id.client.SZRGWClientException; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; /** * Servlet requested for getting the foreign eID @@ -165,20 +166,12 @@ public class GetForeignIDServlet extends AuthServlet { CreateIdentityLinkResponse response = AuthenticationServer.getInstance().getIdentityLink(signature); - if (response.isError()) { - throw new SZRGWClientException(response.getError()); + if (null != response.getErrorResponse()){ + // TODO fix exception parameter + throw new SZRGWClientException(response.getErrorResponse().getErrorCode().toString(), null); } else { - - Element samlAssertion = response.getAssertion(); - - try { - System.out.println("PB: " + DOMUtils.serializeNode(samlAssertion)); - } catch (TransformerException e) { - e.printStackTrace(); - } - - IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(samlAssertion); + IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(new ByteArrayInputStream(response.getIdentityLink())); IdentityLink identitylink = ilParser.parseIdentityLink(); session.setIdentityLink(identitylink); @@ -225,9 +218,9 @@ public class GetForeignIDServlet extends AuthServlet { } catch (MOAIDException ex) { handleError(null, ex, req, resp, pendingRequestID); - } - catch (SZRGWClientException ex) { - handleError(null, ex, req, resp, pendingRequestID); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index b8e823de0..9dede7179 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -3,6 +3,7 @@ */ package at.gv.egovernment.moa.id.auth.stork; +import java.io.ByteArrayInputStream; import java.util.List; import java.util.Vector; @@ -33,14 +34,14 @@ import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttributeImpl; import at.gv.egovernment.moa.id.auth.data.IdentityLink; import at.gv.egovernment.moa.id.auth.exception.ParseException; import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; -import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.CreateIdentityLinkResponse; -import at.gv.egovernment.moa.id.auth.validator.parep.client.szrgw.SZRGWClientException; +import at.gv.egovernment.moa.id.client.SZRGWClientException; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Constants; import at.gv.egovernment.moa.util.DateTimeUtils; import at.gv.egovernment.moa.util.StringUtils; +import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; import eu.stork.mw.messages.saml.STORKResponse; import eu.stork.peps.auth.commons.IPersonalAttributeList; import eu.stork.vidp.messages.common.STORKConstants; @@ -354,18 +355,15 @@ public class STORKResponseProcessor { response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature); } - if (response.isError()) { - Logger.error("Receveid ErrorResponse from SZR Gateway."); - throw new SZRGWClientException(response.getError()); + + if (null != response.getErrorResponse()){ + // TODO fix exception parameter + throw new SZRGWClientException(response.getErrorResponse().getErrorCode().toString(), null); } else { - Logger.trace("Receveid Success Response from SZR Gateway."); - Element samlAssertion = response.getAssertion(); - - IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(samlAssertion); + IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(new ByteArrayInputStream(response.getIdentityLink())); identityLink = ilParser.parseIdentityLink(); - Logger.debug("Received Identity Link from SZR Gateway"); //TODO: is this ok? // if (StringUtils.isEmpty(identityLink.getDateOfBirth())) { @@ -379,9 +377,9 @@ public class STORKResponseProcessor { } catch (ParseException e) { Logger.error("Error parsing IdentityLink received from SZR-Gateway: ", e); throw new STORKException("Error parsing IdentityLink received from SZR-Gateway: ", e); - } catch (at.gv.egovernment.moa.id.client.SZRGWClientException e) { - Logger.error("Error connecting SZR-Gateway: ", e); - throw new STORKException("Error connecting SZR-Gateway: ", e); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); } return identityLink; -- cgit v1.2.3 From 04a2d507dfcf59dac15e542e391797e57a820c82 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Wed, 29 Jan 2014 14:02:05 +0100 Subject: complete workflow untested --- .../moa/id/auth/AuthenticationServer.java | 7 ++-- .../auth/builder/StartAuthenticationBuilder.java | 7 ++-- .../moa/id/auth/data/AuthenticationSession.java | 23 ++++++++++++- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 40 +++++----------------- .../moa/id/auth/stork/STORKResponseProcessor.java | 37 +++++++++----------- .../moa/id/protocols/saml1/GetArtifactAction.java | 14 ++++++++ 6 files changed, 68 insertions(+), 60 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 3dc2639d5..f19881578 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1723,13 +1723,16 @@ public class AuthenticationServer implements MOAIDAuthConstants { // data.setRepresentative(representative); // data.setRepresented(represented); // data.setMandateContent(mandateContent); - request.setPEPSData(data); - + if(null != PEPSIdentifier) + request.setPEPSData(data); + + // TODO add MIS data // request.setMIS(value) Logger.info("Starte Kommunikation mit dem Stammzahlenregister Gateway(" + connectionParameters.getUrl() + ")..."); CreateIdentityLinkResponse response = client.sentCreateIDLRequest(request , connectionParameters.getUrl()); + return response; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java index e4bf37417..3bc152ec8 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java @@ -36,8 +36,7 @@ public class StartAuthenticationBuilder { Logger.info("Starting authentication for a citizen of country: " + (StringUtils.isEmpty(moasession.getCcc()) ? "AT" : moasession.getCcc())); // STORK or normal authentication - //TODO: commented because npe was thrown - /*if (storkConfig.isSTORKAuthentication(moasession.getCcc())) { + if (storkConfig.isSTORKAuthentication(moasession.getCcc())) { //STORK authentication Logger.trace("Found C-PEPS configuration for citizen of country: " + moasession.getCcc()); Logger.debug("Starting STORK authentication"); @@ -45,13 +44,13 @@ public class StartAuthenticationBuilder { AuthenticationServer.startSTORKAuthentication(req, resp, moasession); return ""; - } else {*/ + } else { //normal MOA-ID authentication Logger.debug("Starting normal MOA-ID authentication"); String getIdentityLinkForm = AuthenticationServer.getInstance().startAuthentication(moasession, req); return getIdentityLinkForm; - //} + } } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java index 4a7676ec8..3ab6701c8 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java @@ -26,6 +26,7 @@ import java.util.Vector; import org.w3c.dom.Element; +import eu.stork.peps.auth.commons.IPersonalAttributeList; import eu.stork.peps.auth.commons.STORKAuthnRequest; import at.gv.egovernment.moa.id.auth.validator.InfoboxValidator; @@ -254,7 +255,9 @@ public class AuthenticationSession implements Serializable { private VerifyXMLSignatureResponse XMLVerifySignatureResponse; private boolean isForeigner; - + + private IPersonalAttributeList storkAttributes; + // private String requestedProtocolURL = null; public String getModul() { @@ -962,6 +965,24 @@ public class AuthenticationSession implements Serializable { public void setAuthBlockTokken(String authBlockTokken) { this.authBlockTokken = authBlockTokken; } + + /** + * Memorizes the stork attribute list. + * + * @param personalAttributeList the new stork attributes + */ + public void setStorkAttributes(IPersonalAttributeList personalAttributeList) { + this.storkAttributes = personalAttributeList; + } + + /** + * Recalls the stork attribute list. + * + * @return the stork attributes + */ + public IPersonalAttributeList getStorkAttributes() { + return this.storkAttributes; + } /** // * @return the oAuth20SessionObject diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index f1ee4c181..f05180932 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -78,9 +78,6 @@ public class PEPSConnectorServlet extends AuthServlet { //No authentication session has been started before Logger.error("MOA-SessionID was not found, no previous AuthnRequest had been started"); throw new AuthenticationException("auth.02", new Object[] { moaSessionID }); - } else { - //We know user and MOA takes over session handling, invalidate HttpSession - httpSession.invalidate(); } pendingRequestID = AuthenticationSessionStoreage.getPendingRequestID(moaSessionID); @@ -192,49 +189,28 @@ public class PEPSConnectorServlet extends AuthServlet { Logger.info("Received Identity Link from SZR Gateway"); moaSession.setIdentityLink(identityLink); - Logger.debug("Adding addtional STORK attributes to MOA assertion"); - //add other stork attributes to MOA assertion - List moaExtendedSAMLAttibutes = STORKResponseProcessor.addAdditionalSTORKAttributes(storkAssertion.getAttributeStatements().get(0).getAttributes()); - moaSession.setExtendedSAMLAttributesOA(moaExtendedSAMLAttibutes); + Logger.debug("Adding addtional STORK attributes to MOA session"); + moaSession.setStorkAttributes(authnResponse.getPersonalAttributeList()); //We don't have BKUURL, setting from null to "Not applicable" moaSession.setBkuURL("Not applicable (STORK Authentication)"); - - Logger.debug("Starting to assemble MOA assertion"); - //produce MOA-Assertion and artifact - String samlArtifactBase64 = - AuthenticationServer.getInstance().getForeignAuthenticationData(moaSession); - Logger.info("MOA assertion assembled and SAML Artifact generated."); + + // free for single use + moaSession.setAuthenticatedUsed(false); + + // stork did the authentication step + moaSession.setAuthenticated(true); //session is implicit stored in changeSessionID!!!! String newMOASessionID = AuthenticationSessionStoreage.changeSessionID(moaSession); Logger.info("Changed MOASession " + moaSessionID + " to Session " + newMOASessionID); - Logger.info("Daten angelegt zu MOASession " + newMOASessionID); //redirect String redirectURL = null; - if (!samlArtifactBase64.equals("Redirect to Input Processor")) { - /*redirectURL = moaSession.getOAURLRequested(); - if (!moaSession.getBusinessService()) { - redirectURL = addURLParameter(redirectURL, PARAM_TARGET, URLEncoder.encode(moaSession.getTarget(), "UTF-8")); - } - redirectURL = addURLParameter(redirectURL, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); - redirectURL = response.encodeRedirectURL(redirectURL);*/ - redirectURL = new DataURLBuilder().buildDataURL(moaSession.getAuthURL(), ModulUtils.buildAuthURL(moaSession.getModul(), moaSession.getAction(), pendingRequestID), newMOASessionID); redirectURL = response.encodeRedirectURL(redirectURL); - } else { - - redirectURL = new DataURLBuilder().buildDataURL(moaSession.getAuthURL(), AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, newMOASessionID); - } - - try { - AuthenticationSessionStoreage.storeSession(moaSession); - } catch (MOADatabaseException e) { - throw new MOAIDException("Session store error", null); - } response.setContentType("text/html"); response.setStatus(302); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 9dede7179..664d0cf57 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -14,7 +14,6 @@ import javax.xml.namespace.QName; import org.opensaml.common.binding.BasicSAMLMessageContext; import org.opensaml.saml2.binding.decoding.HTTPPostDecoder; import org.opensaml.saml2.core.Assertion; -import org.opensaml.saml2.core.Attribute; import org.opensaml.saml2.metadata.RequestedAttribute; import org.opensaml.ws.transport.http.HTTPInTransport; import org.opensaml.ws.transport.http.HTTPOutTransport; @@ -35,7 +34,6 @@ import at.gv.egovernment.moa.id.auth.data.IdentityLink; import at.gv.egovernment.moa.id.auth.exception.ParseException; import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; import at.gv.egovernment.moa.id.client.SZRGWClientException; -import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Constants; @@ -44,6 +42,7 @@ import at.gv.egovernment.moa.util.StringUtils; import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; import eu.stork.mw.messages.saml.STORKResponse; import eu.stork.peps.auth.commons.IPersonalAttributeList; +import eu.stork.peps.auth.commons.PersonalAttribute; import eu.stork.vidp.messages.common.STORKConstants; import eu.stork.vidp.messages.util.SAMLUtil; @@ -389,33 +388,29 @@ public class STORKResponseProcessor { /** * Transforms additional STORK attributes to MOA Extended attributes - * @param storkAttributeList STORK attribute list + * @param iPersonalAttributeList STORK attribute list * @return */ - public static List addAdditionalSTORKAttributes(List storkAttributeList) { + public static List addAdditionalSTORKAttributes(IPersonalAttributeList iPersonalAttributeList) { List moaExtendedSAMLAttributeList = new Vector(); + if(null == iPersonalAttributeList) + return moaExtendedSAMLAttributeList; + Logger.trace("Adding the following attributes to MOA assertion: "); int count = 0; - //only add attributes different than eIdentifier, given name, surname, dateOfBirth, signedDoc - for (Attribute attribute : storkAttributeList) { - //attribute is not in default returned attribute set - if (!STORKConstants.DEFAULT_STORK_RETURNED_ATTRIBUTE_SET.contains(attribute.getName())) { - - String attributeValue = null; - if (!attribute.getAttributeValues().isEmpty()) { - //we have attribute value - attributeValue = SAMLUtil.getStringValueFromXMLObject(attribute.getAttributeValues().get(0)); - } - ExtendedSAMLAttribute extendedSAMLAttribute = - new ExtendedSAMLAttributeImpl(attribute.getName(), attributeValue, Constants.STORK_NS_URI, 0); - moaExtendedSAMLAttributeList.add(extendedSAMLAttribute); - count++; - Logger.trace("Additional attribute: " + attribute.getName()); - } + + for (PersonalAttribute attribute : iPersonalAttributeList) { + Object attributeValue = attribute.getValue(); + if (null == attributeValue) + attributeValue = attribute.getComplexValue(); + ExtendedSAMLAttribute extendedSAMLAttribute = + new ExtendedSAMLAttributeImpl(attribute.getName(), attributeValue, Constants.STORK_NS_URI, 0); + moaExtendedSAMLAttributeList.add(extendedSAMLAttribute); + count++; + Logger.trace("Additional attribute: " + attribute.getName()); } - Logger.debug("Added " + count + " STORK attribute(s) to the MOA assertion."); return moaExtendedSAMLAttributeList; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java index fa9dbe990..bf353bce4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java @@ -1,12 +1,17 @@ package at.gv.egovernment.moa.id.protocols.saml1; +import java.util.List; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import at.gv.egovernment.moa.id.auth.AuthenticationServer; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; +import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.servlet.RedirectServlet; +import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.AuthenticationData; @@ -48,6 +53,15 @@ public class GetArtifactAction implements IAction { oaParam, target); + // add other stork attributes to MOA assertion if available + if(null != session.getStorkAttributes()) { + List moaExtendedSAMLAttibutes = STORKResponseProcessor.addAdditionalSTORKAttributes(session.getStorkAttributes()); + session.setExtendedSAMLAttributesOA(moaExtendedSAMLAttibutes); + //produce MOA-Assertion and artifact + AuthenticationServer.getInstance().getForeignAuthenticationData(session); + Logger.info("MOA assertion assembled and SAML Artifact generated."); + } + String samlArtifactBase64 = saml1server.BuildSAMLArtifact(session, oaParam, authData); if (AuthenticationSessionStoreage.isSSOSession(session.getSessionID())) { -- cgit v1.2.3 From 85a983b556baaaa45ea79a4da232a1a72d323708 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Wed, 29 Jan 2014 15:13:42 +0100 Subject: enhanced samlengine for floating config location --- .../moa/id/auth/AuthenticationServer.java | 3 +- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 2 +- .../peps/configuration/ConfigurationReader.java | 18 +++-- .../src/test/resources/SamlEngine.xml | 6 +- .../src/test/resources/SignModule_demo.xml | 12 --- .../src/test/resources/SignModule_outgoing.xml | 12 +++ .../src/test/resources/StorkSamlEngine_demo.xml | 93 ---------------------- .../test/resources/StorkSamlEngine_outgoing.xml | 93 ++++++++++++++++++++++ 8 files changed, 124 insertions(+), 115 deletions(-) delete mode 100644 id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml create mode 100644 id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml delete mode 100644 id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml create mode 100644 id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index f19881578..204e7f724 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1920,11 +1920,12 @@ public class AuthenticationServer implements MOAIDAuthConstants { authnRequest.setEIDSectorShare(true); authnRequest.setCitizenCountryCode("LOCAL"); +// authnRequest.setCitizenCountryCode(moasession.getCcc()); Logger.debug("STORK AuthnRequest succesfully assembled."); - STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("CONF0"); + STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("outgoing"); try { authnRequest = samlEngine.generateSTORKAuthnRequest(authnRequest); } catch (STORKSAMLEngineException e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index f05180932..4819b8219 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -97,7 +97,7 @@ public class PEPSConnectorServlet extends AuthServlet { } //Get SAMLEngine instance - STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF0"); + STORKSAMLEngine engine = STORKSAMLEngine.getInstance("outgoing"); STORKAuthnResponse authnResponse = null; try { diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java index 9ae8bb669..e9b067e76 100644 --- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java +++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java @@ -15,6 +15,7 @@ package eu.stork.peps.configuration; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; @@ -119,8 +120,14 @@ public final class ConfigurationReader { */ public static Map readConfiguration() throws SAMLEngineException { - - LOGGER.info("Init reader: " + ENGINE_CONF_FILE); + + // fetch base from system properties, give a default if there is nothing configured + String base = System.getProperty("eu.stork.samlengine.config.location"); + if(null != base) + if(!base.endsWith("/")) + base += "/"; + + LOGGER.info("Init reader: " + base + ENGINE_CONF_FILE); final Map instanceConfs = new HashMap(); @@ -137,9 +144,10 @@ public final class ConfigurationReader { builder = factory.newDocumentBuilder(); - engineConf = ConfigurationReader.class - .getResourceAsStream("/" + ENGINE_CONF_FILE); - + if(null != base) + engineConf = new FileInputStream(base + ENGINE_CONF_FILE); + else + engineConf = ConfigurationReader.class.getResourceAsStream("/" + ENGINE_CONF_FILE); document = builder.parse(engineConf); diff --git a/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml b/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml index d9dcb34f8..48fd9adff 100644 --- a/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml +++ b/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml @@ -3,10 +3,10 @@ - + - + @@ -14,7 +14,7 @@ - + diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml deleted file mode 100644 index c7cee3af4..000000000 --- a/id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - SWModule sign with JKS. - projects/stork2/code/moa-idspss/id/server/stork2-saml-engine/src/test/resources/storkDemoKeys.jks - local-demo - local-demo - CN=local-demo-cert, O=Indra, L=Madrid, ST=Spain, C=ES - 4BA89DB2 - JKS - \ No newline at end of file diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml new file mode 100644 index 000000000..c7cee3af4 --- /dev/null +++ b/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml @@ -0,0 +1,12 @@ + + + + + SWModule sign with JKS. + projects/stork2/code/moa-idspss/id/server/stork2-saml-engine/src/test/resources/storkDemoKeys.jks + local-demo + local-demo + CN=local-demo-cert, O=Indra, L=Madrid, ST=Spain, C=ES + 4BA89DB2 + JKS + \ No newline at end of file diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml deleted file mode 100644 index f8fc4f91a..000000000 --- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - SAML constants for AuthnRequests and Responses. - - - unspecified - - - obtained - - - entity - - - - HTTP-POST - - - - - - - - - - false - - - true - - - http://S-PEPS.gov.xx - - - http://C-PEPS.gov.xx - - - 300 - - - false - - - - http://www.stork.gov.eu/1.0/eIdentifier - http://www.stork.gov.eu/1.0/givenName - http://www.stork.gov.eu/1.0/surname - http://www.stork.gov.eu/1.0/inheritedFamilyName - http://www.stork.gov.eu/1.0/adoptedFamilyName - http://www.stork.gov.eu/1.0/gender - http://www.stork.gov.eu/1.0/dateOfBirth - http://www.stork.gov.eu/1.0/countryCodeOfBirth - http://www.stork.gov.eu/1.0/nationalityCode - http://www.stork.gov.eu/1.0/maritalStatus - http://www.stork.gov.eu/1.0/residenceAddress - http://www.stork.gov.eu/1.0/eMail - http://www.stork.gov.eu/1.0/academicTitle - http://www.stork.gov.eu/1.0/pseudonym - http://www.stork.gov.eu/1.0/age - http://www.stork.gov.eu/1.0/isAgeOver - - http://www.stork.gov.eu/1.0/textResidenceAddress - http://www.stork.gov.eu/1.0/canonicalResidenceAddress - - http://www.stork.gov.eu/1.0/title - http://www.stork.gov.eu/1.0/residencePermit - - http://www.stork.gov.eu/1.0/signedDoc - http://www.stork.gov.eu/1.0/citizen509Certificate - - http://www.stork.gov.eu/1.0/newAttribute1 - http://www.stork.gov.eu/1.0/newAttribute2 - http://www.stork.gov.eu/1.0/hasDegree - http://www.stork.gov.eu/1.0/mandateContent - http://www.stork.gov.eu/1.0/representative - http://www.stork.gov.eu/1.0/represented - - \ No newline at end of file diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml new file mode 100644 index 000000000..f8fc4f91a --- /dev/null +++ b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml @@ -0,0 +1,93 @@ + + + + + SAML constants for AuthnRequests and Responses. + + + unspecified + + + obtained + + + entity + + + + HTTP-POST + + + + + + + + + + false + + + true + + + http://S-PEPS.gov.xx + + + http://C-PEPS.gov.xx + + + 300 + + + false + + + + http://www.stork.gov.eu/1.0/eIdentifier + http://www.stork.gov.eu/1.0/givenName + http://www.stork.gov.eu/1.0/surname + http://www.stork.gov.eu/1.0/inheritedFamilyName + http://www.stork.gov.eu/1.0/adoptedFamilyName + http://www.stork.gov.eu/1.0/gender + http://www.stork.gov.eu/1.0/dateOfBirth + http://www.stork.gov.eu/1.0/countryCodeOfBirth + http://www.stork.gov.eu/1.0/nationalityCode + http://www.stork.gov.eu/1.0/maritalStatus + http://www.stork.gov.eu/1.0/residenceAddress + http://www.stork.gov.eu/1.0/eMail + http://www.stork.gov.eu/1.0/academicTitle + http://www.stork.gov.eu/1.0/pseudonym + http://www.stork.gov.eu/1.0/age + http://www.stork.gov.eu/1.0/isAgeOver + + http://www.stork.gov.eu/1.0/textResidenceAddress + http://www.stork.gov.eu/1.0/canonicalResidenceAddress + + http://www.stork.gov.eu/1.0/title + http://www.stork.gov.eu/1.0/residencePermit + + http://www.stork.gov.eu/1.0/signedDoc + http://www.stork.gov.eu/1.0/citizen509Certificate + + http://www.stork.gov.eu/1.0/newAttribute1 + http://www.stork.gov.eu/1.0/newAttribute2 + http://www.stork.gov.eu/1.0/hasDegree + http://www.stork.gov.eu/1.0/mandateContent + http://www.stork.gov.eu/1.0/representative + http://www.stork.gov.eu/1.0/represented + + \ No newline at end of file -- cgit v1.2.3 From 3e512ed4c85444fcbd3d364ffa48aa3291813b73 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 30 Jan 2014 13:14:34 +0100 Subject: supply organization details on representative case --- .../moa/id/auth/AuthenticationServer.java | 36 +++++++++++++++++----- .../moa/id/auth/stork/STORKResponseProcessor.java | 16 ++++++++-- 2 files changed, 41 insertions(+), 11 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 204e7f724..d77119f4a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1699,7 +1699,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException */ - public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String citizenSignature, String represented, String representative, String mandateContent) throws SZRGWClientException { + public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType) throws SZRGWClientException { SZRGWClient client = null; @@ -1712,20 +1712,19 @@ public class AuthenticationServer implements MOAIDAuthConstants { CreateIdentityLinkRequest request = new CreateIdentityLinkRequest(); request.setSignature(citizenSignature.getBytes()); - + PEPSData data = new PEPSData(); data.setDateOfBirth(PEPSDateOfBirth); data.setFamilyname(PEPSFamilyname); data.setFirstname(PEPSFirstname); data.setIdentifier(PEPSIdentifier); -// TODO add mandate data -// data.setRepresentative(representative); -// data.setRepresented(represented); -// data.setMandateContent(mandateContent); + data.setRepresentative(representative); + data.setRepresented(represented); + data.setMandateContent(mandateContent); - if(null != PEPSIdentifier) - request.setPEPSData(data); + data.setLegalPersonCanonicalRegisteredAddress(organizationAddress); + data.setLegalPersonTranslatableType(organizationType); // TODO add MIS data // request.setMIS(value) @@ -1812,6 +1811,27 @@ public class AuthenticationServer implements MOAIDAuthConstants { public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException { return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, signature, null, null, null); } + + /** + * SZR-GW Client interface. + * + * @param eIdentifier the e identifier + * @param givenName the given name + * @param lastName the last name + * @param dateOfBirth the date of birth + * @param citizenSignature the citizen signature + * @param representative the representative + * @param represented the represented + * @param mandate the mandate + * @return the identity link + * @throws SZRGWClientException the sZRGW client exception + */ + public CreateIdentityLinkResponse getIdentityLink(String eIdentifier, + String givenName, String lastName, String dateOfBirth, + String citizenSignature, String representative, String represented, + String mandate) throws SZRGWClientException { + return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate, null, null); + } /** * Starts a MOA-ID authentication process using STORK diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 664d0cf57..e81adfb52 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -345,10 +345,20 @@ public class STORKResponseProcessor { String representative = getAttributeValue("representative", attributeList); String represented = getAttributeValue("represented", attributeList); String mandate = getAttributeValue("mandateContent", attributeList); + + // we definitely know we have a representation case here + // lets try if the represented is an organization + try { + String organizationAddress = getAttributeValue("canonicalRegisteredAddress", attributeList); + String organizationType = getAttributeValue("translateableType", attributeList); + + // if we got here, we have a natural person representing a legal person + response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate, organizationAddress, organizationType); + } catch(STORKException e1) { - // if we get here we have a representation case - response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate); - + // if we get here we have natural persons representing each other + response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate); + } } catch(STORKException e) { // we do not have a representation case response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature); -- cgit v1.2.3 From 58b19f33806927a753d76ff2d2f79e44353b0e03 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 30 Jan 2014 15:12:04 +0100 Subject: refactored attribute parsing --- .../moa/id/auth/AuthenticationServer.java | 59 +++++------------ .../moa/id/auth/servlet/PEPSConnectorServlet.java | 19 +----- .../moa/id/auth/stork/STORKResponseProcessor.java | 76 ++++++++++++++-------- 3 files changed, 67 insertions(+), 87 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index d77119f4a..5ae3d8e47 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1733,53 +1733,12 @@ public class AuthenticationServer implements MOAIDAuthConstants { CreateIdentityLinkResponse response = client.sentCreateIDLRequest(request , connectionParameters.getUrl()); return response; - - -// client.setAddress(connectionParameters.getUrl()); -// if (connectionParameters.getUrl().toLowerCase().startsWith("https:")) { -// Logger.debug("Initialisiere SSL Verbindung"); -// try { -// client.setSSLSocketFactory(SSLUtils.getSSLSocketFactory(AuthConfigurationProvider.getInstance(), connectionParameters)); -// } catch (IOException e) { -// Logger.error("Could not initialize SSL Factory", e); -// throw new SZRGWClientException("Could not initialize SSL Factory"); -// } catch (GeneralSecurityException e) { -// Logger.error("Could not initialize SSL Factory", e); -// throw new SZRGWClientException("Could not initialize SSL Factory"); -// } catch (PKIException e) { -// Logger.error("Could not initialize SSL Factory", e); -// throw new SZRGWClientException("Could not initialize SSL Factory"); -// } -// } } catch (ConfigurationException e) { Logger.warn(e); Logger.warn(MOAIDMessageProvider.getInstance().getMessage("config.12", null )); } -// // create request -// CreateIdentityLinkResponse response = null; -// Element request = null; -// try { -// Document doc = client.buildGetIdentityLinkRequest(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, signature); -// request = doc.getDocumentElement(); -// -// // send request -// response = client.createIdentityLinkResponse(request, connectionParameters.getUrl()); -// -// -// -// } catch (SZRGWClientException e) { -// // give him a second try - Nach dem Starten des Tomcat wird beim ersten Mal das Client-Zertifikat offenbar vom HTTPClient nicht mitgeschickt. -//// try { -//// response = client.createIdentityLinkResponse(request); -//// } -//// catch (SZRGWClientException e1) { -//// throw new SZRGWClientException(e1); -//// } -// } - - return null; } @@ -1811,6 +1770,24 @@ public class AuthenticationServer implements MOAIDAuthConstants { public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException { return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, signature, null, null, null); } + + /** + * Gets the identity link. + * + * @param citizenSignature the citizen signature + * @param representative the representative + * @param represented the represented + * @param mandate the mandate + * @param organizationAddress the organization address + * @param organizationType the organization type + * @return the identity link + * @throws SZRGWClientException + */ + public CreateIdentityLinkResponse getIdentityLink(String citizenSignature, + String representative, String represented, String mandateContent, + String organizationAddress, String organizationType) throws SZRGWClientException { + return getIdentityLink(null, null, null, null, citizenSignature, represented, representative, mandateContent, organizationAddress, organizationType); + } /** * SZR-GW Client interface. diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index 4819b8219..45e6ab816 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -137,29 +137,12 @@ public class PEPSConnectorServlet extends AuthServlet { Logger.debug("Found a preceeding STORK AuthnRequest to this MOA session: " + moaSessionID); -// Logger.debug("Starting validation of SAML assertion"); -// //verify SAML assertion - Assertion storkAssertion = authnResponse.getAssertions().get(0); -// try { -// STORKResponseProcessor.verifySTORKAssertion( -// storkAssertion, //assertion -// request.getRemoteAddr(), //IP address of user -// storkAuthnRequest.getID(), //ID of STORK AuthnRequest -// request.getRequestURL().toString(), //destination -// HTTPUtils.getBaseURL(request), //audience -// storkAuthnRequest.getRequestedAttributes()); //Requested Attributes -// } catch (STORKException e) { -// Logger.error("Failed to verify STORK SAML Assertion", e); -// throw new MOAIDException("stork.08", null); -// } -// -// Logger.info("SAML assertion succesfully verified!"); - Logger.debug("Starting extraction of signedDoc attribute"); //extract signed doc element and citizen signature Element citizenSignature = null; try { + Assertion storkAssertion = authnResponse.getAssertions().get(0); citizenSignature = STORKResponseProcessor.extractCitizenSignature(storkAssertion); moaSession.setAuthBlock(DOMUtils.serializeNode(citizenSignature)); moaSession.setSignerCertificate(AuthenticationServer.getCertificateFromXML(citizenSignature)); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index e81adfb52..466d86f87 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -296,6 +296,22 @@ public class STORKResponseProcessor { } + + /** + * Checks for attribute. + * + * @param attributeName the attribute name + * @param attributeList the attribute list + * @return true, if successful + */ + private static boolean hasAttribute(String attributeName, IPersonalAttributeList attributeList) { + try { + getAttributeValue(attributeName, attributeList); + return true; + } catch(STORKException e) { + return false; + } + } /** * helper for reading attributes. Handles logging and error handling. @@ -325,52 +341,56 @@ public class STORKResponseProcessor { public static IdentityLink connectToSZRGateway(IPersonalAttributeList attributeList) throws STORKException { Logger.trace("Calling SZR Gateway with the following attributes:"); - // fetch mandatory attributes - String citizenSignature = getAttributeValue("signedDoc", attributeList); - String eIdentifier = getAttributeValue("eIdentifier", attributeList); - String givenName = getAttributeValue("givenName", attributeList); - String lastName = getAttributeValue("surname", attributeList); - String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); - if (!StringUtils.isEmpty(dateOfBirth)) { - dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); - } - - CreateIdentityLinkResponse response; + CreateIdentityLinkResponse identityLinkResponse = null; IdentityLink identityLink = null; try { Logger.trace("Starting call..."); - // do we have a case of representation? - try { + + // if there is no signedDoc attribute, we cannot go on + String citizenSignature = getAttributeValue("signedDoc", attributeList); + + // if we have a signedDoc we test for a representation case + if(hasAttribute("mandateContent", attributeList) || hasAttribute("representative", attributeList) || hasAttribute("represented", attributeList)) { + // we have a representation case String representative = getAttributeValue("representative", attributeList); String represented = getAttributeValue("represented", attributeList); String mandate = getAttributeValue("mandateContent", attributeList); - // we definitely know we have a representation case here - // lets try if the represented is an organization - try { + if(!hasAttribute("dateOfBirth", attributeList)) { + // if we get here, we have a natural person representing a legal person String organizationAddress = getAttributeValue("canonicalRegisteredAddress", attributeList); String organizationType = getAttributeValue("translateableType", attributeList); - // if we got here, we have a natural person representing a legal person - response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate, organizationAddress, organizationType); - } catch(STORKException e1) { + identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(citizenSignature, representative, represented, mandate, organizationAddress, organizationType); + } else { + // if we get here, we have a natural person representing another natural person + String eIdentifier = getAttributeValue("eIdentifier", attributeList); + String givenName = getAttributeValue("givenName", attributeList); + String lastName = getAttributeValue("surname", attributeList); + String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); + if (!StringUtils.isEmpty(dateOfBirth)) + dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); - // if we get here we have natural persons representing each other - response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate); + identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate); } - } catch(STORKException e) { + } else { // we do not have a representation case - response = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature); + String eIdentifier = getAttributeValue("eIdentifier", attributeList); + String givenName = getAttributeValue("givenName", attributeList); + String lastName = getAttributeValue("surname", attributeList); + String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); + if (!StringUtils.isEmpty(dateOfBirth)) + dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); + identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature); } - - - if (null != response.getErrorResponse()){ + + if (null != identityLinkResponse.getErrorResponse()){ // TODO fix exception parameter - throw new SZRGWClientException(response.getErrorResponse().getErrorCode().toString(), null); + throw new SZRGWClientException(identityLinkResponse.getErrorResponse().getErrorCode().toString(), null); } else { - IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(new ByteArrayInputStream(response.getIdentityLink())); + IdentityLinkAssertionParser ilParser = new IdentityLinkAssertionParser(new ByteArrayInputStream(identityLinkResponse.getIdentityLink())); identityLink = ilParser.parseIdentityLink(); Logger.debug("Received Identity Link from SZR Gateway"); -- cgit v1.2.3 From 1c72a260e3633eb8e411992ac25fc747ec71513c Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 30 Jan 2014 17:43:18 +0100 Subject: fixed samlengine config loading --- .../java/eu/stork/peps/auth/engine/core/impl/SignSW.java | 13 +++++++++++-- .../eu/stork/peps/configuration/ConfigurationCreator.java | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'id/server') diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java index 9f0a88c84..4554a9586 100644 --- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java +++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java @@ -74,6 +74,7 @@ import org.slf4j.LoggerFactory; import eu.stork.peps.auth.engine.core.CustomAttributeQuery; import eu.stork.peps.auth.engine.core.SAMLEngineSignI; +import eu.stork.peps.configuration.ConfigurationReader; import eu.stork.peps.exceptions.SAMLEngineException; @@ -159,8 +160,16 @@ public class SignSW implements SAMLEngineSignI { throws SAMLEngineException { InputStream fileProperties = null; try { - fileProperties = SignSW.class.getResourceAsStream("/" - + fileConf); + // fetch base from system properties, give a default if there is nothing configured + String base = System.getProperty("eu.stork.samlengine.config.location"); + if(null != base) + if(!base.endsWith("/")) + base += "/"; + + if(null != base) + fileProperties = new FileInputStream(base + fileConf); + else + fileProperties = SignSW.class.getResourceAsStream("/" + fileConf); properties = new Properties(); properties.loadFromXML(fileProperties); diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java index 2fabff7d6..b40e3f7dd 100644 --- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java +++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java @@ -15,6 +15,7 @@ package eu.stork.peps.configuration; +import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; @@ -103,8 +104,16 @@ public final class ConfigurationCreator { LOGGER.info("Create file configuration properties to Stork Saml Engine."); InputStream fileEngineProp = null; try { - fileEngineProp = ConfigurationCreator.class - .getResourceAsStream("/" + fileName); + // fetch base from system properties, give a default if there is nothing configured + String base = System.getProperty("eu.stork.samlengine.config.location"); + if(null != base) + if(!base.endsWith("/")) + base += "/"; + + if(null != base) + fileEngineProp = new FileInputStream(base + fileName); + else + fileEngineProp = ConfigurationCreator.class.getResourceAsStream("/" + fileName); final Properties configuration = new Properties(); configuration.loadFromXML(fileEngineProp); return configuration; -- cgit v1.2.3 From b04ffb6167dca0a3d1c116953b23aebe1ddf4e32 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 30 Jan 2014 18:05:19 +0100 Subject: gender retrieval if not delivered by stork --- .../moa/id/auth/AuthenticationServer.java | 12 ++--- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 54 ++++++++++++++++++++++ .../moa/id/auth/stork/STORKResponseProcessor.java | 7 ++- .../resources/resources/templates/fetchGender.html | 16 +++++++ 4 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 id/server/idserverlib/src/main/resources/resources/templates/fetchGender.html (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 5ae3d8e47..ec1762cbf 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1699,7 +1699,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException */ - public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType) throws SZRGWClientException { + public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String gender, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType) throws SZRGWClientException { SZRGWClient client = null; @@ -1752,7 +1752,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws ConfigurationException the configuration exception */ public CreateIdentityLinkResponse getIdentityLink(Element signature) throws SZRGWClientException, ConfigurationException { - return getIdentityLink(null, null, null, null, XMLHelper.nodeToString(signature), null, null, null); + return getIdentityLink(null, null, null, null, null, XMLHelper.nodeToString(signature), null, null, null); } /** @@ -1768,7 +1768,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws ConfigurationException the configuration exception */ public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException { - return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, signature, null, null, null); + return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, null, signature, null, null, null); } /** @@ -1786,7 +1786,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { public CreateIdentityLinkResponse getIdentityLink(String citizenSignature, String representative, String represented, String mandateContent, String organizationAddress, String organizationType) throws SZRGWClientException { - return getIdentityLink(null, null, null, null, citizenSignature, represented, representative, mandateContent, organizationAddress, organizationType); + return getIdentityLink(null, null, null, null, null, citizenSignature, represented, representative, mandateContent, organizationAddress, organizationType); } /** @@ -1804,10 +1804,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException the sZRGW client exception */ public CreateIdentityLinkResponse getIdentityLink(String eIdentifier, - String givenName, String lastName, String dateOfBirth, + String givenName, String lastName, String dateOfBirth, String gender, String citizenSignature, String representative, String represented, String mandate) throws SZRGWClientException { - return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate, null, null); + return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, representative, represented, mandate, null, null); } /** diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index 45e6ab816..a1d38d488 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -1,6 +1,8 @@ package at.gv.egovernment.moa.id.auth.servlet; import java.io.IOException; +import java.io.StringWriter; +import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; @@ -9,6 +11,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; import org.opensaml.saml2.core.Assertion; import org.opensaml.saml2.core.StatusCode; import org.w3c.dom.Element; @@ -22,6 +27,7 @@ import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.stork.STORKException; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; +import at.gv.egovernment.moa.id.auth.stork.VelocityProvider; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; @@ -30,6 +36,7 @@ import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.DOMUtils; import at.gv.egovernment.moa.util.StringUtils; import eu.stork.peps.auth.commons.PEPSUtil; +import eu.stork.peps.auth.commons.PersonalAttribute; import eu.stork.peps.auth.commons.STORKAuthnRequest; import eu.stork.peps.auth.commons.STORKAuthnResponse; import eu.stork.peps.auth.engine.STORKSAMLEngine; @@ -154,12 +161,59 @@ public class PEPSConnectorServlet extends AuthServlet { Logger.debug("Foregin Citizen signature successfully extracted from STORK Assertion (signedDoc)"); Logger.debug("Citizen signature will be verified by SZR Gateway!"); + ////////////// incorporate gender from parameters if not in stork response + + PersonalAttribute gender = authnResponse.getPersonalAttributeList().get("gender"); + if(null == gender) { + String gendervalue = (String) request.getParameter("gender"); + if(null != gendervalue) { + gender = new PersonalAttribute(); + gender.setName("gender"); + ArrayList tmp = new ArrayList(); + tmp.add(gendervalue); + gender.setValue(tmp); + + authnResponse.getPersonalAttributeList().add(gender); + } + } + + ////////////////////////////////////////////////////////////////////////// + + Logger.debug("Starting connecting SZR Gateway"); //contact SZR Gateway IdentityLink identityLink = null; try { identityLink = STORKResponseProcessor.connectToSZRGateway(authnResponse.getPersonalAttributeList()); } catch (STORKException e) { + // this is really nasty but we work against the system here. We are supposed to get the gender attribute from + // stork. If we do not, we cannot register the person in the ERnP - we have to have the + // gender for the represented person. So here comes the dirty hack. + if(e.getMessage().equals("gender not found in response")) { + // fetch gender + + try { + Logger.trace("Initialize VelocityEngine..."); + + VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine(); + Template template = velocityEngine.getTemplate("/resources/templates/fetchGender.html"); + VelocityContext context = new VelocityContext(); + context.put("SAMLResponse", request.getParameter("SAMLResponse")); + context.put("action", request.getRequestURL()); + + StringWriter writer = new StringWriter(); + template.merge(context, writer); + +// response.setContentType("text/html"); + response.getOutputStream().write(writer.toString().getBytes()); + } catch (Exception e1) { + Logger.error("Error sending gender retrival form.", e1); + httpSession.invalidate(); + throw new MOAIDException("stork.10", null); + } + + return; + } Logger.error("Error connecting SZR Gateway", e); throw new MOAIDException("stork.10", null); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 466d86f87..5406dc0e1 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -369,10 +369,13 @@ public class STORKResponseProcessor { String givenName = getAttributeValue("givenName", attributeList); String lastName = getAttributeValue("surname", attributeList); String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); + + // gender attribute is mandatory here because of some legal stuff +// String gender = getAttributeValue("gender", attributeList); if (!StringUtils.isEmpty(dateOfBirth)) dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); - identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, citizenSignature, representative, represented, mandate); + identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, representative, represented, mandate); } } else { // we do not have a representation case @@ -406,6 +409,8 @@ public class STORKResponseProcessor { } catch (ParseException e) { Logger.error("Error parsing IdentityLink received from SZR-Gateway: ", e); throw new STORKException("Error parsing IdentityLink received from SZR-Gateway: ", e); + } catch(STORKException e) { + throw e; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/id/server/idserverlib/src/main/resources/resources/templates/fetchGender.html b/id/server/idserverlib/src/main/resources/resources/templates/fetchGender.html new file mode 100644 index 000000000..f47ee53ff --- /dev/null +++ b/id/server/idserverlib/src/main/resources/resources/templates/fetchGender.html @@ -0,0 +1,16 @@ + + + +
+
+ +
+

Please indicate the gender of the represented.

+
+ + +
+
+ + + \ No newline at end of file -- cgit v1.2.3 From 8449c5ab138f0b7a1760cb5f2aa6db2eb9d0b22e Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 30 Jan 2014 19:04:02 +0100 Subject: added stork signature client api - untested --- id/server/idserverlib/pom.xml | 5 +++ .../moa/id/auth/AuthenticationServer.java | 36 ++++++++++++++------ .../moa/id/auth/servlet/PEPSConnectorServlet.java | 39 ++++++++++++---------- 3 files changed, 53 insertions(+), 27 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml index 8a9cdd51f..245348d09 100644 --- a/id/server/idserverlib/pom.xml +++ b/id/server/idserverlib/pom.xml @@ -37,6 +37,11 @@ SamlEngine 1.1.0 + + eu.stork + oasis-dss-api + 1.0.0-SNAPSHOT + MOA.id.server moa-id-commons diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index ec1762cbf..decf166c4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -58,6 +58,7 @@ import org.opensaml.common.IdentifierGenerator; import org.opensaml.common.impl.SecureRandomIdentifierGenerator; import org.opensaml.xml.util.Base64; import org.opensaml.xml.util.XMLHelper; +import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -137,6 +138,11 @@ import at.gv.egovernment.moa.util.XPathUtils; import at.gv.util.xsd.srzgw.CreateIdentityLinkRequest; import at.gv.util.xsd.srzgw.CreateIdentityLinkRequest.PEPSData; import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; +import eu.stork.oasisdss.api.ApiUtils; +import eu.stork.oasisdss.api.ApiUtilsException; +import eu.stork.oasisdss.profile.DocumentType; +import eu.stork.oasisdss.profile.InputDocuments; +import eu.stork.oasisdss.profile.SignRequest; import eu.stork.peps.auth.commons.PEPSUtil; import eu.stork.peps.auth.commons.PersonalAttribute; import eu.stork.peps.auth.commons.PersonalAttributeList; @@ -1882,7 +1888,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { PersonalAttribute newAttribute = new PersonalAttribute(); newAttribute.setName("signedDoc"); List value = new ArrayList(); - value.add(generateDssSignRequest(Base64.encodeBytes(CreateXMLSignatureRequestBuilder.buildForeignIDTextToBeSigned("wie im Signaturzertifikat (as in my signature certificate)", oaParam, moasession).getBytes()), "application/xhtml+xml")); + value.add(generateDssSignRequest(CreateXMLSignatureRequestBuilder.buildForeignIDTextToBeSigned("wie im Signaturzertifikat (as in my signature certificate)", oaParam, moasession), "application/xhtml+xml")); newAttribute.setValue(value); attributeList.add(newAttribute); @@ -1978,18 +1984,28 @@ public class AuthenticationServer implements MOAIDAuthConstants { IdentifierGenerator idGenerator; try { idGenerator = new SecureRandomIdentifierGenerator(); - - return "" + - "" + - "" + - "" + text + "" + - "" + - "" + - ""; + + DocumentType doc = new DocumentType(); + doc.setBase64XML(Base64.encodeBytes(text.getBytes()).getBytes()); + + SignRequest request = new SignRequest(); + request.setInputDocuments(ApiUtils.createInputDocuments(doc)); + + request.setRequestID(idGenerator.generateIdentifier()); + + return ApiUtils.marshalToDocument(request).getTextContent(); } catch (NoSuchAlgorithmException e) { Logger.error("Cannot generate id", e); throw new RuntimeException(e); + } catch (ApiUtilsException e) { + Logger.error("Could not create SignRequest", e); + throw new RuntimeException(e); + } catch (DOMException e) { + Logger.error("Could not create SignRequest", e); + throw new RuntimeException(e); + } catch (ParserConfigurationException e) { + Logger.error("Could not create SignRequest", e); + throw new RuntimeException(e); } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index a1d38d488..3129c9e31 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -10,6 +10,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import javax.xml.transform.stream.StreamSource; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; @@ -30,11 +31,15 @@ import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.auth.stork.VelocityProvider; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.moduls.ModulUtils; +import at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParser; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; import at.gv.egovernment.moa.id.util.HTTPUtils; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.DOMUtils; import at.gv.egovernment.moa.util.StringUtils; +import eu.stork.oasisdss.api.ApiUtils; +import eu.stork.oasisdss.api.LightweightSourceResolver; +import eu.stork.oasisdss.profile.SignResponse; import eu.stork.peps.auth.commons.PEPSUtil; import eu.stork.peps.auth.commons.PersonalAttribute; import eu.stork.peps.auth.commons.STORKAuthnRequest; @@ -144,23 +149,6 @@ public class PEPSConnectorServlet extends AuthServlet { Logger.debug("Found a preceeding STORK AuthnRequest to this MOA session: " + moaSessionID); - Logger.debug("Starting extraction of signedDoc attribute"); - //extract signed doc element and citizen signature - Element citizenSignature = null; - try { - - Assertion storkAssertion = authnResponse.getAssertions().get(0); - citizenSignature = STORKResponseProcessor.extractCitizenSignature(storkAssertion); - moaSession.setAuthBlock(DOMUtils.serializeNode(citizenSignature)); - moaSession.setSignerCertificate(AuthenticationServer.getCertificateFromXML(citizenSignature)); - - } catch (Exception e) { - Logger.error("Could not extract citizen signature from C-PEPS", e); - throw new MOAIDException("stork.09", null); - } - Logger.debug("Foregin Citizen signature successfully extracted from STORK Assertion (signedDoc)"); - Logger.debug("Citizen signature will be verified by SZR Gateway!"); - ////////////// incorporate gender from parameters if not in stork response PersonalAttribute gender = authnResponse.getPersonalAttributeList().get("gender"); @@ -179,6 +167,23 @@ public class PEPSConnectorServlet extends AuthServlet { ////////////////////////////////////////////////////////////////////////// + Logger.debug("Starting extraction of signedDoc attribute"); + //extract signed doc element and citizen signature + String citizenSignature = null; + try { + citizenSignature = authnResponse.getPersonalAttributeList().get("signedDoc").getValue().get(0); + moaSession.setAuthBlock(citizenSignature); + + // FIXME untested + Element sepp = (Element) ApiUtils.unmarshal(new StreamSource(new java.io.StringReader(citizenSignature))); + moaSession.setSignerCertificate(AuthenticationServer.getCertificateFromXML(sepp)); + + } catch (Exception e) { + Logger.error("Could not extract citizen signature from C-PEPS", e); + throw new MOAIDException("stork.09", null); + } + Logger.debug("Foregin Citizen signature successfully extracted from STORK Assertion (signedDoc)"); + Logger.debug("Citizen signature will be verified by SZR Gateway!"); Logger.debug("Starting connecting SZR Gateway"); //contact SZR Gateway -- cgit v1.2.3 From 20c7b74026da669ff560281e69b4df37392154fd Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 30 Jan 2014 20:49:58 +0100 Subject: supply MIS information to SZRGW --- .../moa/id/auth/AuthenticationServer.java | 45 ++++++++++++++++------ .../moa/id/auth/servlet/PEPSConnectorServlet.java | 21 +++++++++- .../moa/id/auth/stork/STORKResponseProcessor.java | 12 ++++-- 3 files changed, 63 insertions(+), 15 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index decf166c4..60b269059 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -135,9 +135,13 @@ import at.gv.egovernment.moa.util.FileUtils; import at.gv.egovernment.moa.util.MiscUtil; import at.gv.egovernment.moa.util.StringUtils; import at.gv.egovernment.moa.util.XPathUtils; +import at.gv.util.xsd.mis.MandateIdentifiers; +import at.gv.util.xsd.mis.Target; import at.gv.util.xsd.srzgw.CreateIdentityLinkRequest; import at.gv.util.xsd.srzgw.CreateIdentityLinkRequest.PEPSData; import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; +import at.gv.util.xsd.srzgw.MISType; +import at.gv.util.xsd.srzgw.MISType.Filters; import eu.stork.oasisdss.api.ApiUtils; import eu.stork.oasisdss.api.ApiUtilsException; import eu.stork.oasisdss.profile.DocumentType; @@ -1700,20 +1704,19 @@ public class AuthenticationServer implements MOAIDAuthConstants { /** * Does the request to the SZR-GW - * @param signature XMLDSIG signature + * @param oaFriendlyName + * @param signature XMLDSIG signature * @return Identity link assertion * @throws SZRGWClientException */ - public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String gender, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType) throws SZRGWClientException { + public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String gender, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType, String target, String oaFriendlyName, String filters) throws SZRGWClientException { - SZRGWClient client = null; - try { AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); ConnectionParameter connectionParameters = authConf.getForeignIDConnectionParameter(); - client = new SZRGWClient(connectionParameters); + SZRGWClient client = new SZRGWClient(connectionParameters); CreateIdentityLinkRequest request = new CreateIdentityLinkRequest(); @@ -1732,8 +1735,24 @@ public class AuthenticationServer implements MOAIDAuthConstants { data.setLegalPersonCanonicalRegisteredAddress(organizationAddress); data.setLegalPersonTranslatableType(organizationType); - // TODO add MIS data -// request.setMIS(value) + if(null != mandateContent) { + MISType mis = new MISType(); + + Target targetObject = new Target(); + targetObject.setValue(target); + mis.setTarget(targetObject); + + mis.setOAFriendlyName(oaFriendlyName); + + Filters filterObject = new Filters(); + MandateIdentifiers mandateIds = new MandateIdentifiers(); + for(String current : filters.split(",")) + mandateIds.getMandateIdentifier().add(current.trim()); + filterObject.setMandateIdentifiers(mandateIds); + mis.setFilters(filterObject); + + request.setMIS(mis); + } Logger.info("Starte Kommunikation mit dem Stammzahlenregister Gateway(" + connectionParameters.getUrl() + ")..."); CreateIdentityLinkResponse response = client.sentCreateIDLRequest(request , connectionParameters.getUrl()); @@ -1791,8 +1810,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { */ public CreateIdentityLinkResponse getIdentityLink(String citizenSignature, String representative, String represented, String mandateContent, - String organizationAddress, String organizationType) throws SZRGWClientException { - return getIdentityLink(null, null, null, null, null, citizenSignature, represented, representative, mandateContent, organizationAddress, organizationType); + String organizationAddress, String organizationType, String target, String oaFriendlyName, String filters) throws SZRGWClientException { + return getIdentityLink(null, null, null, null, null, + citizenSignature, represented, representative, mandateContent, organizationAddress, + organizationType, target, oaFriendlyName, filters); } /** @@ -1812,8 +1833,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { public CreateIdentityLinkResponse getIdentityLink(String eIdentifier, String givenName, String lastName, String dateOfBirth, String gender, String citizenSignature, String representative, String represented, - String mandate) throws SZRGWClientException { - return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, representative, represented, mandate, null, null); + String mandate, String target, String oaFriendlyName, String filters) throws SZRGWClientException { + return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, + citizenSignature, representative, represented, mandate, null, + null, target, oaFriendlyName, filters); } /** diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index 3129c9e31..bd8c6420d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -30,6 +30,8 @@ import at.gv.egovernment.moa.id.auth.stork.STORKException; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.auth.stork.VelocityProvider; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParser; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; @@ -185,11 +187,28 @@ public class PEPSConnectorServlet extends AuthServlet { Logger.debug("Foregin Citizen signature successfully extracted from STORK Assertion (signedDoc)"); Logger.debug("Citizen signature will be verified by SZR Gateway!"); + Logger.debug("fetching OAParameters from database"); + + //read configuration paramters of OA + AuthenticationSession moasession; + try { + moasession = AuthenticationSessionStoreage.getSession(moaSessionID); + } catch (MOADatabaseException e2) { + Logger.error("could not retrieve moa session"); + throw new AuthenticationException("auth.01", null); + } + OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix()); + if (oaParam == null) + throw new AuthenticationException("auth.00", new Object[] { moasession.getPublicOAURLPrefix() }); + Logger.debug("Starting connecting SZR Gateway"); //contact SZR Gateway IdentityLink identityLink = null; try { - identityLink = STORKResponseProcessor.connectToSZRGateway(authnResponse.getPersonalAttributeList()); + identityLink = STORKResponseProcessor.connectToSZRGateway(authnResponse.getPersonalAttributeList(), + oaParam.getFriendlyName(), + oaParam.getTarget(), + oaParam.getMandateProfiles()); } catch (STORKException e) { // this is really nasty but we work against the system here. We are supposed to get the gender attribute from // stork. If we do not, we cannot register the person in the ERnP - we have to have the diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 5406dc0e1..8385c5dbe 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -334,11 +334,15 @@ public class STORKResponseProcessor { /** * Handels connection to SZR-GW and returns Identity Link on success + * @param oaFriendlyName + * @param target + * @param filters + * @param filter * @param iPersonalAttributeList Received attribute List in assertion * @return Identity Link * @throws STORKException */ - public static IdentityLink connectToSZRGateway(IPersonalAttributeList attributeList) throws STORKException { + public static IdentityLink connectToSZRGateway(IPersonalAttributeList attributeList, String oaFriendlyName, String target, String filters) throws STORKException { Logger.trace("Calling SZR Gateway with the following attributes:"); CreateIdentityLinkResponse identityLinkResponse = null; @@ -362,7 +366,7 @@ public class STORKResponseProcessor { String organizationAddress = getAttributeValue("canonicalRegisteredAddress", attributeList); String organizationType = getAttributeValue("translateableType", attributeList); - identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(citizenSignature, representative, represented, mandate, organizationAddress, organizationType); + identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(citizenSignature, representative, represented, mandate, organizationAddress, organizationType, target, oaFriendlyName, filters); } else { // if we get here, we have a natural person representing another natural person String eIdentifier = getAttributeValue("eIdentifier", attributeList); @@ -375,7 +379,9 @@ public class STORKResponseProcessor { if (!StringUtils.isEmpty(dateOfBirth)) dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); - identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, representative, represented, mandate); + identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, + givenName, lastName, dateOfBirth, gender, citizenSignature, representative, + represented, mandate, target, oaFriendlyName, filters); } } else { // we do not have a representation case -- cgit v1.2.3 From e1e410da00a399a8b059645a14a7848b39d3525c Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 30 Jan 2014 20:59:16 +0100 Subject: removed old saml-engine --- id/server/idserverlib/pom.xml | 7 - .../moa/id/auth/stork/STORKResponseProcessor.java | 189 --- id/server/stork-saml-engine/pom.xml | 92 -- .../stork/mw/messages/saml/STORKAuthnRequest.java | 139 -- .../eu/stork/mw/messages/saml/STORKResponse.java | 52 - .../messages/builder/STORKMessagesBuilder.java | 1367 -------------------- .../stork/vidp/messages/common/STORKBootstrap.java | 75 -- .../stork/vidp/messages/common/STORKConstants.java | 176 --- .../vidp/messages/exception/SAMLException.java | 60 - .../exception/SAMLValidationException.java | 60 - .../stork/vidp/messages/saml/STORKAttribute.java | 65 - .../vidp/messages/saml/STORKAttributeValue.java | 51 - .../stork/vidp/messages/saml/STORKExtensions.java | 78 -- .../messages/saml/STORKRequestedAttribute.java | 53 - .../messages/saml/impl/STORKAttributeBuilder.java | 60 - .../messages/saml/impl/STORKAttributeImpl.java | 63 - .../saml/impl/STORKAttributeMarshaller.java | 56 - .../saml/impl/STORKAttributeUnmarshaller.java | 58 - .../saml/impl/STORKAuthnRequestBuilder.java | 48 - .../messages/saml/impl/STORKAuthnRequestImpl.java | 170 --- .../saml/impl/STORKAuthnRequestMarshaller.java | 44 - .../saml/impl/STORKAuthnRequestUnmarshaller.java | 137 -- .../messages/saml/impl/STORKExtensionsBuilder.java | 45 - .../messages/saml/impl/STORKExtensionsImpl.java | 74 -- .../saml/impl/STORKExtensionsMarshaller.java | 32 - .../saml/impl/STORKExtensionsUnmarshaller.java | 58 - .../saml/impl/STORKRequestedAttributeBuilder.java | 57 - .../saml/impl/STORKRequestedAttributeImpl.java | 66 - .../impl/STORKRequestedAttributeUnmarshaller.java | 64 - .../messages/saml/impl/STORKResponseBuilder.java | 48 - .../vidp/messages/saml/impl/STORKResponseImpl.java | 59 - .../saml/impl/STORKResponseMarshaller.java | 44 - .../saml/impl/STORKResponseUnmarshaller.java | 51 - .../messages/stork/AuthenticationAttributes.java | 55 - .../vidp/messages/stork/CitizenCountryCode.java | 48 - .../vidp/messages/stork/EIDCrossBorderShare.java | 54 - .../vidp/messages/stork/EIDCrossSectorShare.java | 54 - .../stork/vidp/messages/stork/EIDSectorShare.java | 54 - .../stork/QualityAuthenticationAssuranceLevel.java | 48 - .../vidp/messages/stork/RequestedAttributes.java | 58 - .../stork/vidp/messages/stork/SPAuthRequest.java | 46 - .../eu/stork/vidp/messages/stork/SPCertEnc.java | 44 - .../eu/stork/vidp/messages/stork/SPCertSig.java | 44 - .../eu/stork/vidp/messages/stork/SPCertType.java | 49 - .../java/eu/stork/vidp/messages/stork/SPID.java | 48 - .../stork/vidp/messages/stork/SPInformation.java | 67 - .../stork/vidp/messages/stork/SpApplication.java | 48 - .../eu/stork/vidp/messages/stork/SpCountry.java | 48 - .../stork/vidp/messages/stork/SpInstitution.java | 48 - .../eu/stork/vidp/messages/stork/SpSector.java | 48 - .../stork/VIDPAuthenticationAttributes.java | 60 - .../impl/AuthenticationAttributesBuilder.java | 46 - .../stork/impl/AuthenticationAttributesImpl.java | 74 -- .../impl/AuthenticationAttributesMarshaller.java | 35 - .../impl/AuthenticationAttributesUnmarshaller.java | 52 - .../stork/impl/CitizenCountryCodeBuilder.java | 46 - .../stork/impl/CitizenCountryCodeImpl.java | 60 - .../stork/impl/CitizenCountryCodeMarshaller.java | 45 - .../stork/impl/CitizenCountryCodeUnmarshaller.java | 45 - .../stork/impl/EIDCrossBorderShareBuilder.java | 46 - .../stork/impl/EIDCrossBorderShareImpl.java | 80 -- .../stork/impl/EIDCrossBorderShareMarshaller.java | 45 - .../impl/EIDCrossBorderShareUnmarshaller.java | 45 - .../stork/impl/EIDCrossSectorShareBuilder.java | 46 - .../stork/impl/EIDCrossSectorShareImpl.java | 80 -- .../stork/impl/EIDCrossSectorShareMarshaller.java | 45 - .../impl/EIDCrossSectorShareUnmarshaller.java | 45 - .../messages/stork/impl/EIDSectorShareBuilder.java | 46 - .../messages/stork/impl/EIDSectorShareImpl.java | 80 -- .../stork/impl/EIDSectorShareMarshaller.java | 45 - .../stork/impl/EIDSectorShareUnmarshaller.java | 45 - ...QualityAuthenticationAssuranceLevelBuilder.java | 46 - .../QualityAuthenticationAssuranceLevelImpl.java | 60 - ...lityAuthenticationAssuranceLevelMarshaller.java | 45 - ...tyAuthenticationAssuranceLevelUnmarshaller.java | 45 - .../stork/impl/RequestedAttributesBuilder.java | 58 - .../stork/impl/RequestedAttributesImpl.java | 88 -- .../stork/impl/RequestedAttributesMarshaller.java | 40 - .../impl/RequestedAttributesUnmarshaller.java | 55 - .../messages/stork/impl/SPAuthRequestBuilder.java | 50 - .../messages/stork/impl/SPAuthRequestImpl.java | 76 -- .../stork/impl/SPAuthRequestMarshaller.java | 57 - .../stork/impl/SPAuthRequestUnmarshaller.java | 70 - .../vidp/messages/stork/impl/SPCertEncBuilder.java | 46 - .../vidp/messages/stork/impl/SPCertEncImpl.java | 39 - .../messages/stork/impl/SPCertEncMarshaller.java | 34 - .../messages/stork/impl/SPCertEncUnmarshaller.java | 33 - .../vidp/messages/stork/impl/SPCertSigBuilder.java | 46 - .../vidp/messages/stork/impl/SPCertSigImpl.java | 39 - .../messages/stork/impl/SPCertSigMarshaller.java | 34 - .../messages/stork/impl/SPCertSigUnmarshaller.java | 33 - .../vidp/messages/stork/impl/SPCertTypeImpl.java | 72 -- .../messages/stork/impl/SPCertTypeMarshaller.java | 34 - .../stork/impl/SPCertTypeUnmarshaller.java | 53 - .../vidp/messages/stork/impl/SPIDBuilder.java | 46 - .../stork/vidp/messages/stork/impl/SPIDImpl.java | 60 - .../vidp/messages/stork/impl/SPIDMarshaller.java | 45 - .../vidp/messages/stork/impl/SPIDUnmarshaller.java | 45 - .../messages/stork/impl/SPInformationBuilder.java | 46 - .../messages/stork/impl/SPInformationImpl.java | 121 -- .../stork/impl/SPInformationMarshaller.java | 35 - .../stork/impl/SPInformationUnmarshaller.java | 61 - .../messages/stork/impl/SpApplicationBuilder.java | 46 - .../messages/stork/impl/SpApplicationImpl.java | 60 - .../stork/impl/SpApplicationMarshaller.java | 45 - .../stork/impl/SpApplicationUnmarshaller.java | 45 - .../vidp/messages/stork/impl/SpCountryBuilder.java | 46 - .../vidp/messages/stork/impl/SpCountryImpl.java | 60 - .../messages/stork/impl/SpCountryMarshaller.java | 45 - .../messages/stork/impl/SpCountryUnmarshaller.java | 45 - .../messages/stork/impl/SpInstitutionBuilder.java | 46 - .../messages/stork/impl/SpInstitutionImpl.java | 60 - .../stork/impl/SpInstitutionMarshaller.java | 45 - .../stork/impl/SpInstitutionUnmarshaller.java | 45 - .../vidp/messages/stork/impl/SpSectorBuilder.java | 47 - .../vidp/messages/stork/impl/SpSectorImpl.java | 60 - .../messages/stork/impl/SpSectorMarshaller.java | 45 - .../messages/stork/impl/SpSectorUnmarshaller.java | 45 - .../impl/VIDPAuthenticationAttributesBuilder.java | 46 - .../impl/VIDPAuthenticationAttributesImpl.java | 91 -- .../VIDPAuthenticationAttributesMarshaller.java | 35 - .../VIDPAuthenticationAttributesUnmarshaller.java | 55 - .../java/eu/stork/vidp/messages/util/SAMLUtil.java | 414 ------ .../validation/StorkAssertionValidator.java | 91 -- .../validation/StorkAttributeValidator.java | 204 --- .../StorkAudienceRestrictionValidator.java | 56 - .../StorkAuthenticationAttributesValidator.java | 57 - .../validation/StorkAuthnRequestValidator.java | 137 -- .../validation/StorkAuthnStatementValidator.java | 62 - .../StorkCitizenCountryCodeValidator.java | 63 - .../validation/StorkConditionsValidator.java | 70 - .../validation/StorkEIDSectorShareValidator.java | 51 - .../StorkEncryptedAttributeValidator.java | 50 - .../validation/StorkEncryptedIdValidator.java | 51 - .../validation/StorkExtensionsValidator.java | 66 - .../messages/validation/StorkIssuerValidator.java | 61 - .../messages/validation/StorkNameIDValidator.java | 67 - .../validation/StorkNameIdPolicyValidator.java | 52 - ...alityAuthenticationAssuranceLevelValidator.java | 54 - .../StorkRequestedAttributeValidator.java | 92 -- .../StorkRequestedAttributesValidator.java | 45 - .../validation/StorkResponseValidator.java | 137 -- .../messages/validation/StorkSPIDValidator.java | 64 - .../validation/StorkSPInformationValidator.java | 49 - .../validation/StorkSpApplicationValidator.java | 63 - .../validation/StorkSpCountryValidator.java | 58 - .../validation/StorkSpInstitutionValidator.java | 62 - .../validation/StorkSpSectorValidator.java | 65 - .../validation/StorkStatusCodeValidator.java | 139 -- .../messages/validation/StorkStatusValidator.java | 55 - .../StorkSubjectConfirmationValidator.java | 128 -- .../validation/StorkSubjectLocalityValidator.java | 47 - .../messages/validation/StorkSubjectValidator.java | 60 - ...StorkVIDPAuthenticationAttributesValidator.java | 57 - .../src/main/resources/saml2-post-binding-moa.vm | 38 - .../src/main/resources/saml2-stork-config.xml | 242 ---- 156 files changed, 11301 deletions(-) delete mode 100644 id/server/stork-saml-engine/pom.xml delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/mw/messages/saml/STORKAuthnRequest.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/mw/messages/saml/STORKResponse.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/builder/STORKMessagesBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/common/STORKBootstrap.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/common/STORKConstants.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/exception/SAMLException.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/exception/SAMLValidationException.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKAttribute.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKAttributeValue.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKExtensions.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKRequestedAttribute.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/AuthenticationAttributes.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/CitizenCountryCode.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDCrossBorderShare.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDCrossSectorShare.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDSectorShare.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/QualityAuthenticationAssuranceLevel.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/RequestedAttributes.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPAuthRequest.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertEnc.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertSig.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertType.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPID.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPInformation.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpApplication.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpCountry.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpInstitution.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpSector.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/VIDPAuthenticationAttributes.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesBuilder.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesImpl.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesMarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesUnmarshaller.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/util/SAMLUtil.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAssertionValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAttributeValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAudienceRestrictionValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthenticationAttributesValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthnRequestValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthnStatementValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkCitizenCountryCodeValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkConditionsValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEIDSectorShareValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEncryptedAttributeValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEncryptedIdValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkExtensionsValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkIssuerValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkNameIDValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkNameIdPolicyValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkQualityAuthenticationAssuranceLevelValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkRequestedAttributeValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkRequestedAttributesValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkResponseValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSPIDValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSPInformationValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpApplicationValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpCountryValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpInstitutionValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpSectorValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkStatusCodeValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkStatusValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectConfirmationValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectLocalityValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkVIDPAuthenticationAttributesValidator.java delete mode 100644 id/server/stork-saml-engine/src/main/resources/saml2-post-binding-moa.vm delete mode 100644 id/server/stork-saml-engine/src/main/resources/saml2-stork-config.xml (limited to 'id/server') diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml index 245348d09..1efa46c7d 100644 --- a/id/server/idserverlib/pom.xml +++ b/id/server/idserverlib/pom.xml @@ -25,13 +25,6 @@ - - - MOA.id - stork-saml-engine - 1.5.2 - - eu.stork SamlEngine diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 8385c5dbe..6d88a1684 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -40,11 +40,8 @@ import at.gv.egovernment.moa.util.Constants; import at.gv.egovernment.moa.util.DateTimeUtils; import at.gv.egovernment.moa.util.StringUtils; import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; -import eu.stork.mw.messages.saml.STORKResponse; import eu.stork.peps.auth.commons.IPersonalAttributeList; import eu.stork.peps.auth.commons.PersonalAttribute; -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.util.SAMLUtil; /** * @@ -60,192 +57,6 @@ public class STORKResponseProcessor { /** OASIS DSS Success Message */ public static final String OASIS_DSS_SUCCESS_MSG = "urn:oasis:names:tc:dss:1.0:resultmajor:Success"; - /** - * Extracts a STORK response from a HTTP message - * @param request HttpServletRequest - * @param response HttpServletResponse - * @return STORK Response - * @throws STORKException - */ - public static STORKResponse receiveSTORKRepsonse(HttpServletRequest request, HttpServletResponse response) throws STORKException { - - HTTPInTransport httpInTransport = new HttpServletRequestAdapter(request); - HTTPOutTransport httpOutTransport = new HttpServletResponseAdapter(response, request.isSecure()); - - httpInTransport.getPeerAddress(); - - String samlResponseString = request.getParameter("SAMLResponse"); - - if (StringUtils.isEmpty(samlResponseString)) { - Logger.error("SAMLResponse not found in request."); - throw new STORKException("SAMLResponse not found in request."); - } - - BasicSAMLMessageContext samlMessageContext = new BasicSAMLMessageContext(); - - samlMessageContext.setInboundMessageTransport(httpInTransport); - samlMessageContext.setOutboundMessageTransport(httpOutTransport); - - HTTPPostDecoder postDecoder = new HTTPPostDecoder(); - - try { - postDecoder.decode(samlMessageContext); - } catch (Exception e) { - Logger.error("Error decoding SAMLResponse message", e); - throw new STORKException("Error decoding SAMLResponse message", e); - } - - if (!(samlMessageContext.getInboundSAMLMessage() instanceof STORKResponse)) { - Logger.error("Message received is not a SAMLResponse message"); - throw new STORKException("Message received is not a SAMLResponse message"); - } - - STORKResponse samlResponse = (STORKResponse) samlMessageContext.getInboundSAMLMessage(); - - return samlResponse; - } - - /** - * Verifies a STORK response according STORK specification - * @param storkResponse STORK Response to verify - * @throws STORKException if validation fails - */ - public static void verifySTORKResponse(STORKResponse storkResponse) throws STORKException { - - ResponseVerifier responseVerifier = new PEPSConnectorResponseVerifier(); - try { - responseVerifier.verify(storkResponse); - } catch (SecurityException e) { - Logger.error("Error validating response message from PEPS.", e); - throw new STORKException("Error validating response message from PEPS."); - } - - } - - /** - * Verifies a STORK assertion - * @param assertion STORK assertion - * @param ipAddress Client IP address - * @param authnRequestID ID of the AuthnRequest - * @param recipient recipient for verification - * @param audience audience for verification - * @param reqAttributeList RequestedAttribute list for verification - * @throws STORKException - */ - public static void verifySTORKAssertion( - Assertion assertion, - String ipAddress, - String authnRequestID, - String recipient, - String audience, - List reqAttributeList) throws STORKException { - - //validate Assertion - AssertionVerifier assertionVerifier = new PEPSConnectorAssertionVerifier(); - try { - assertionVerifier.verify(assertion, ipAddress, authnRequestID, recipient, audience, reqAttributeList); - - //verify if all required attributes are present - PEPSConnectorAssertionVerifier.validateRequiredAttributes(reqAttributeList, assertion.getAttributeStatements().get(0).getAttributes()); - - } catch (SecurityException e) { - Logger.error("Error verifying assertion from PEPS", e); - throw new STORKException("Error validating assertion received from PEPS."); - } - - } - - /** - * Extracts the citizen signature from the signedDoc element present in the STORK assertion - * @param storkAssertion STORK assertion - * @return citizen signature as XML - * @throws STORKException - */ - public static Element extractCitizenSignature(Assertion storkAssertion) throws STORKException { - - Logger.debug("Processing DSS signature response from PEPS"); - - Element signatureResponse = getSignedDocAttributeValue(storkAssertion); - - if (signatureResponse == null) { - String msg = "Could not find DSS signature response in SAML assertion"; - Logger.error(msg); - throw new STORKException(msg); - } - - Logger.debug("Found DSS signature in SAML assertion"); - - Logger.debug("DSS Signature creation response received from PEPS (pretty print):"); - Logger.debug(XMLHelper.prettyPrintXML(signatureResponse)); - Logger.trace("DSS Signature creation response received from PEPS (original):"); - Logger.trace(XMLUtil.printXML(signatureResponse)); - - Element signature = getSignature(signatureResponse); - - if (signature == null) { - String msg = "Could not find citizen signature in SAML assertion"; - Logger.error(msg); - throw new STORKException(msg); - } - - Logger.debug("Found foreign citizen signature in SAML assertion (pretty print):"); - Logger.debug(XMLHelper.prettyPrintXML(signature)); - Logger.trace("Found foreign citizen signature in SAML assertion (original):"); - Logger.trace(XMLUtil.printXML(signature)); - - return signature; - } - - /** - * Extracts the signedDoc attribute from a STORK assertion as XML - * @param storkAssertion STORK assertion - * @return Value of signedDoc attribute - * @throws STORKException - */ - private static Element getSignedDocAttributeValue(Assertion storkAssertion) throws STORKException { - - XMLObject xmlObj = SAMLUtil.getAttributeValue(storkAssertion.getAttributeStatements().get(0).getAttributes(), STORKConstants.STORK_ATTRIBUTE_SIGNEDDOC); - - - if (xmlObj instanceof XSAny) - return getSignedDocAttributeValueFromAny((XSAny) xmlObj); - else if (xmlObj instanceof XSString) - return getSignedDocAttributValueFromString((XSString) xmlObj); - else - return null; - - } - - /** - * Get signedDoc as XML if provided as anyType - * @param any AttributeValue as anyType - * @return signedDoc as XML - */ - private static Element getSignedDocAttributeValueFromAny(XSAny any) { - if (!any.getUnknownXMLObjects(new QName(OASIS_DSS_NS, "SignResponse")).isEmpty()) { - XMLObject xmlObj = any.getUnknownXMLObjects(new QName(OASIS_DSS_NS, "SignResponse")).get(0); - return xmlObj.getDOM(); - } else { - return null; - } - } - - /** - * Get signedDoc as XML if provided as String - * @param string AttributeValue as String - * @return signedDoc as XML - * @throws STORKException - */ - private static Element getSignedDocAttributValueFromString(XSString string) throws STORKException { - try { - return XMLUtil.stringToDOM(string.getValue()); - } catch (Exception e) { - Logger.error("Error building DOM", e); - throw new STORKException(e); - - } - } - /** * Extracts the signature value out of a DSS response * @param signatureResponse DSS signature response diff --git a/id/server/stork-saml-engine/pom.xml b/id/server/stork-saml-engine/pom.xml deleted file mode 100644 index 1988b9af0..000000000 --- a/id/server/stork-saml-engine/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - 4.0.0 - - moa-id - MOA.id - 1.9.96-SNAPSHOT - - stork-saml-engine - 1.5.2 - STORK SAML Engine - SAML2 related stuff for STORK - - - - - -org.apache.maven.plugins -maven-compiler-plugin - -1.5 -1.5 - - - - - - - - org.opensaml - opensaml - 2.5.3 - - - org.slf4j - jcl-over-slf4j - - - org.slf4j - jul-to-slf4j - - - org.slf4j - log4j-over-slf4j - - - - - org.opensaml - xmltooling - 1.3.4 - - - org.slf4j - jcl-over-slf4j - - - org.slf4j - jul-to-slf4j - - - org.slf4j - log4j-over-slf4j - - - - - org.opensaml - openws - 1.4.4 - - - org.slf4j - jcl-over-slf4j - - - org.slf4j - jul-to-slf4j - - - org.slf4j - log4j-over-slf4j - - - - - org.slf4j - slf4j-log4j12 - 1.6.4 - - - - \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/mw/messages/saml/STORKAuthnRequest.java b/id/server/stork-saml-engine/src/main/java/eu/stork/mw/messages/saml/STORKAuthnRequest.java deleted file mode 100644 index b84721ff5..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/mw/messages/saml/STORKAuthnRequest.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.mw.messages.saml; - -import java.security.cert.X509Certificate; -import java.util.List; - -import org.opensaml.saml2.core.AuthnRequest; -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.xml.XMLObject; - -/** - * Interface extending a SAML AuthnRequest by additional attributes required by STORK - * @author bzwattendorfer - * - */ -public interface STORKAuthnRequest extends AuthnRequest { - - /** - * Sets the ID of the requesting Service Provider - * @param spID ID of the Service Provider - */ - public void setSPID(String spID); - - /** - * Gets the ID of the Service Provider - * @return ID of the Service Provider - */ - public String getSPID(); - - /** - * Sets the citizen country code - * @param citizenCountryCode citizen country code - */ - public void setCitizenCountryCode(String citizenCountryCode); - - /** - * Gets the citizen country code - * @return citizen country code - */ - public String getCitizenCountryCode(); - - /** - * Sets the final redirect URL - * @param finalRedirectURL Final redirect URL - */ - public void setFinalRedirectURL(String finalRedirectURL); - - /** - * Gets the final redirect URL - * @return final redirect URL - */ - public String getFinalRedirectURL(); - - /** - * Sets the signing certificate of the service provider - * @param signingCertificate Signing certificate of the SP - */ - public void setSPCertSig(X509Certificate signingCertificate); - - /** - * Gets the signing certificate of the service provider - * @return signing certificate of the service provider - */ - public X509Certificate getSPCertSig(); - - /** - * Sets the encryption certificate of the service provider - * @param encryptionCertificate encryption certificate of the SP - */ - public void setSPCertEnc(X509Certificate encryptionCertificate); - - /** - * Gets the encryption certificate of the service provider - * @return encryption certificate of the SP - */ - public X509Certificate getSPCertEnc(); - - - /** - * Sets the original authentication request of the service provider - * @param spAuthRequest original SP authentication request - */ - public void setOriginalSPAuthRequest(XMLObject spAuthRequest); - - /** - * Gets the original authentication request of the service provider - * @return original SP authentication request - */ - public XMLObject getOriginalSPAuthRequest(); - - /** - * Sets the requested STORK QAA level - * @param authLevel Requested STORK QAA level - */ - public void setQAALevel(int authLevel); - - /** - * Gets the requested STORK QAA level - * @return Requested STORK QAA level - */ - public int getQAALevel(); - - /** - * Gets a list of requested attributes - * @return List containg all requested attributes - */ - public List getRequestedAttributes(); - - /** - * Sets the requested attributes - * @param requestedAttributesList List containg all requested attributes - */ - public void setRequestedAttributes(List requestedAttributesList); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/mw/messages/saml/STORKResponse.java b/id/server/stork-saml-engine/src/main/java/eu/stork/mw/messages/saml/STORKResponse.java deleted file mode 100644 index 28de6068b..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/mw/messages/saml/STORKResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.mw.messages.saml; - -import org.opensaml.saml2.core.Response; - -/** - * Interface extending a SAML Response by attributes required by STORK - * @author bzwattendorfer - * - */ -public interface STORKResponse extends Response { - - /** - * Sets the QAA level by which the user has been authenticated - * @param authLevel STORK QAA level used for authentication - */ - public void setQAALevel(int authLevel); - - /** - * Gets the QAA level by which the user has been authenticated - * @return STORK QAA level used for authentication - */ - public int getQAALevel(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/builder/STORKMessagesBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/builder/STORKMessagesBuilder.java deleted file mode 100644 index 2f9a19620..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/builder/STORKMessagesBuilder.java +++ /dev/null @@ -1,1367 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.builder; - -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateEncodingException; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.commons.lang.StringUtils; -import org.joda.time.DateTime; -import org.opensaml.Configuration; -import org.opensaml.common.IdentifierGenerator; -import org.opensaml.common.SAMLObject; -import org.opensaml.common.SAMLObjectBuilder; -import org.opensaml.common.SAMLVersion; -import org.opensaml.common.impl.SecureRandomIdentifierGenerator; -import org.opensaml.common.xml.SAMLConstants; -import org.opensaml.saml2.core.Assertion; -import org.opensaml.saml2.core.Attribute; -import org.opensaml.saml2.core.AttributeStatement; -import org.opensaml.saml2.core.AttributeValue; -import org.opensaml.saml2.core.Audience; -import org.opensaml.saml2.core.AudienceRestriction; -import org.opensaml.saml2.core.AuthnContext; -import org.opensaml.saml2.core.AuthnStatement; -import org.opensaml.saml2.core.Conditions; -import org.opensaml.saml2.core.Issuer; -import org.opensaml.saml2.core.NameID; -import org.opensaml.saml2.core.OneTimeUse; -import org.opensaml.saml2.core.Status; -import org.opensaml.saml2.core.StatusCode; -import org.opensaml.saml2.core.StatusDetail; -import org.opensaml.saml2.core.StatusMessage; -import org.opensaml.saml2.core.Subject; -import org.opensaml.saml2.core.SubjectConfirmation; -import org.opensaml.saml2.core.SubjectConfirmationData; -import org.opensaml.saml2.core.SubjectLocality; -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.ws.soap.common.SOAPObject; -import org.opensaml.ws.soap.common.SOAPObjectBuilder; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.XMLObjectBuilder; -import org.opensaml.xml.schema.XSAny; -import org.opensaml.xml.schema.XSString; -import org.opensaml.xml.schema.impl.XSAnyBuilder; -import org.opensaml.xml.schema.impl.XSStringBuilder; -import org.opensaml.xml.signature.KeyInfo; -import org.opensaml.xml.signature.X509Data; -import org.opensaml.xml.util.Base64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import eu.stork.mw.messages.saml.STORKAuthnRequest; -import eu.stork.mw.messages.saml.STORKResponse; -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.saml.STORKAttribute; -import eu.stork.vidp.messages.saml.STORKAttributeValue; -import eu.stork.vidp.messages.saml.STORKExtensions; -import eu.stork.vidp.messages.saml.STORKRequestedAttribute; -import eu.stork.vidp.messages.stork.AuthenticationAttributes; -import eu.stork.vidp.messages.stork.CitizenCountryCode; -import eu.stork.vidp.messages.stork.EIDCrossBorderShare; -import eu.stork.vidp.messages.stork.EIDCrossSectorShare; -import eu.stork.vidp.messages.stork.EIDSectorShare; -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; -import eu.stork.vidp.messages.stork.RequestedAttributes; -import eu.stork.vidp.messages.stork.SPAuthRequest; -import eu.stork.vidp.messages.stork.SPCertEnc; -import eu.stork.vidp.messages.stork.SPCertSig; -import eu.stork.vidp.messages.stork.SPCertType; -import eu.stork.vidp.messages.stork.SPID; -import eu.stork.vidp.messages.stork.SPInformation; -import eu.stork.vidp.messages.stork.SpApplication; -import eu.stork.vidp.messages.stork.SpCountry; -import eu.stork.vidp.messages.stork.SpInstitution; -import eu.stork.vidp.messages.stork.SpSector; -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -/** - * Class providing several methods for SAML Object generation - * @author bzwattendorfer - * - */ -public class STORKMessagesBuilder { - - final static Logger log = LoggerFactory.getLogger(STORKMessagesBuilder.class); - - /** - * Builds an arbitrary OpenSAML XML object - * @param OpenSAML XMLObject - * @param objectQName QName of the XML element - * @return Builded OpenSAML XMLObject - */ - @SuppressWarnings("unchecked") - public static T buildXMLObject(QName objectQName) { - - try { - XMLObjectBuilder builder = (XMLObjectBuilder) Configuration.getBuilderFactory().getBuilder(objectQName); - return builder.buildObject(objectQName.getNamespaceURI(), objectQName.getLocalPart(), objectQName.getPrefix()); - } catch (Exception e) { - log.error("Cannot build XML Object {}: {}", objectQName.getLocalPart(), e); - throw new RuntimeException(e); - } - - } - - /** - * Builds a SOAP object - * @param SOAP Object or any extensions - * @param objectQName QName of the XML element - * @return SOAP Object or any extensions - */ - @SuppressWarnings("unchecked") - public static T buildSOAPObject(QName objectQName) { - - try { - SOAPObjectBuilder builder = (SOAPObjectBuilder) Configuration.getBuilderFactory().getBuilder(objectQName); - return builder.buildObject(); - } catch (Exception e) { - log.error("Cannot build SOAP Object {}: {}", objectQName.getLocalPart(), e); - throw new RuntimeException(e); - } - - } - - /** - * Builds an arbitrary OpenSAML SAML object - * @param OpenSAML SAML Object - * @param objectQName QName of the SAML element - * @return Builded OpenSAML SAML Object - */ - @SuppressWarnings("unchecked") - public static T buildSAMLObject(QName objectQName) { - - try { - SAMLObjectBuilder builder = (SAMLObjectBuilder) Configuration.getBuilderFactory().getBuilder(objectQName); - return builder.buildObject(); - } catch (Exception e) { - log.error("Cannot build SAML Object {}: {}", objectQName.getLocalPart(), e); - throw new RuntimeException(e); - } - - } - - - - /** - * Builds SAML Issuer object - * @param issuerValue Value for the issuer element - * @return Issuer object - */ - public static Issuer buildIssuer(String issuerValue) { - if (StringUtils.isEmpty(issuerValue)) - return null; - - Issuer issuer = buildXMLObject(Issuer.DEFAULT_ELEMENT_NAME); - issuer.setValue(issuerValue); - issuer.setFormat(Issuer.ENTITY); - - return issuer; - } - - /** - * Builds a QualityAuthenticationAssuranceLevel object - * @param qaaValue QAALevel (1 to 4) - * @return QualityAuthenticationAssuranceLevel object - */ - public static QualityAuthenticationAssuranceLevel buildQualityAuthenticationAssuranceLevel(int qaaValue) { - if (qaaValue < 1 || qaaValue > 4) { - log.error("QAA Level must be between 1 and 4."); - return null; - } - - QualityAuthenticationAssuranceLevel qaaLevel = buildXMLObject(QualityAuthenticationAssuranceLevel.DEFAULT_ELEMENT_NAME); - qaaLevel.setValue(qaaValue); - return qaaLevel; - } - - /** - * Builds a STORK RequestedAttribute object - * @param name Name of the RequesteAttribute - * @param isRequired true or false if RequestedAttribute is required - * @param value Value of RequestedAttribute - * @return STORK RequestedAttribute object - */ - public static RequestedAttribute buildRequestedAttribute(String name, boolean isRequired, String value) { - - RequestedAttribute reqAttribute = buildXMLObject(STORKRequestedAttribute.DEFAULT_ELEMENT_NAME); - reqAttribute.setName(name); - reqAttribute.setNameFormat(STORKRequestedAttribute.URI_REFERENCE); - reqAttribute.setIsRequired(isRequired); - - if (!StringUtils.isEmpty(value)) { - XSString stringValue = buildXSString(STORKAttributeValue.DEFAULT_ELEMENT_NAME); - stringValue.setValue(value); - reqAttribute.getAttributeValues().add(stringValue); - } - - return reqAttribute; - } - - /** - * Builds XML String type object with given QName - * @param qname QName for object to build - * @return XML object as String type - */ - public static XSString buildXSString(QName qname) { - XSStringBuilder stringBuilder = (XSStringBuilder) Configuration.getBuilderFactory().getBuilder(XSString.TYPE_NAME); - return stringBuilder.buildObject(qname, XSString.TYPE_NAME); - } - - /** - * Builds XML Any type object with given QName - * @param qname QName for object to build - * @return XML object as Any type - */ - public static XSAny buildXSAny(QName qname) { - XSAnyBuilder anyBuilder = (XSAnyBuilder) Configuration.getBuilderFactory().getBuilder(XSAny.TYPE_NAME); - return anyBuilder.buildObject(qname, XSAny.TYPE_NAME); - } - - /** - * Builds a List of RequestedAttribute - * @param requestedAttributeArguments RequestedAttributes - * @return List of RequestedAttribute - */ - public static RequestedAttributes buildRequestedAttributes(RequestedAttribute... requestedAttributeArguments) { - - if (requestedAttributeArguments == null) - return null; - - RequestedAttributes reqAttributes = buildXMLObject(RequestedAttributes.DEFAULT_ELEMENT_NAME); - - for (RequestedAttribute reqAttr : requestedAttributeArguments) { - reqAttributes.getRequestedAttributes().add(reqAttr); - } - - return reqAttributes; - } - - /** - * Builds RequestedAttributes object out of list of RequestedAttribute - * @param requestedAttributeList List of RequestedAttribute - * @return RequestedAttributes object - */ - public static RequestedAttributes buildRequestedAttributes(List requestedAttributeList) { - if (requestedAttributeList == null) - return null; - - RequestedAttributes reqAttributes = buildXMLObject(RequestedAttributes.DEFAULT_ELEMENT_NAME); - reqAttributes.getRequestedAttributes().addAll(requestedAttributeList); - - return reqAttributes; - } - - /** - * Builds a STORK CitizenCountryCode object - * @param ccc ISO country code - * @return CitizenCountryCode object - */ - public static CitizenCountryCode buildCitizenCountryCode(String ccc) { - if (StringUtils.isEmpty(ccc)) { - log.error("CitizenCountryCode must have a value."); - return null; - } - - CitizenCountryCode citizenCountryCode = buildXMLObject(CitizenCountryCode.DEFAULT_ELEMENT_NAME); - citizenCountryCode.setValue(ccc); - - return citizenCountryCode; - } - - /** - * Builds a SPID object - * @param spIDString String to be used as SPID - * @return SPID object - */ - public static SPID buildSPID(String spIDString) { - if (StringUtils.isEmpty(spIDString)) { - log.error("SPID must have a value."); - return null; - } - - SPID spID = buildXMLObject(SPID.DEFAULT_ELEMENT_NAME); - spID.setValue(spIDString); - - return spID; - } - - /** - * Builds SPCertType - * @param cert X509Certificate - * @return SPCertType - */ - private static SPCertType buildSPCertType(X509Certificate cert) { - SPCertType spCertType = buildXMLObject(SPCertType.TYPE_NAME); - KeyInfo keyInfo = buildXMLObject(KeyInfo.DEFAULT_ELEMENT_NAME); - X509Data x509DataElem = buildXMLObject(X509Data.DEFAULT_ELEMENT_NAME); - org.opensaml.xml.signature.X509Certificate x509CertElem = buildXMLObject(org.opensaml.xml.signature.X509Certificate.DEFAULT_ELEMENT_NAME); - - try { - x509CertElem.setValue(Base64.encodeBytes(cert.getEncoded())); - } catch (CertificateEncodingException e) { - log.error("Cannot encode certificate.", e); - throw new RuntimeException(e); - } - - x509DataElem.getX509Certificates().add(x509CertElem); - keyInfo.getX509Datas().add(x509DataElem); - spCertType.setKeyInfo(keyInfo); - return spCertType; - } - - /** - * Builds SPCertSig object - * @param cert X509Certificate - * @return SPCertSig - */ - public static SPCertSig buildSPCertSig(X509Certificate cert) { - return (SPCertSig) buildSPCertType(cert); - } - - /** - * Builds SPCertEnc object - * @param cert X509Certificate - * @return SPCertEnc - */ - public static SPCertEnc buildSPCertEnc(X509Certificate cert) { - return (SPCertEnc) buildSPCertType(cert); - } - - /** - * Builds SPAuthRequest object - * @param xmlObject Abritrary XML object - * @return SPAuthRequest - */ - public static SPAuthRequest buildSPAuthRequest(XMLObject xmlObject) { - SPAuthRequest authRequest = buildXMLObject(SPAuthRequest.DEFAULT_ELEMENT_NAME); - authRequest.getUnknownXMLObjects().add(xmlObject); - return authRequest; - } - - /** - * Builds SPInformation object - * @param spIDString SPID - * @param sigCert SP signature certificate - * @param encCert SP encryption certificate - * @param spAuthRequest Original SP AuthnRequest - * @return SPInformations - */ - public static SPInformation buildSPInformation(String spIDString, X509Certificate sigCert, X509Certificate encCert, XMLObject spAuthRequest) { - - SPInformation spInformation = buildXMLObject(SPInformation.DEFAULT_ELEMENT_NAME); - - SPID spID = buildSPID(spIDString); - spInformation.setSPID(spID); - - if (sigCert != null) { - SPCertSig spCertSig = buildSPCertSig(sigCert); - spInformation.setSPCertSig(spCertSig); - } - - if (encCert != null) { - SPCertEnc spCertEnc = buildSPCertEnc(encCert); - spInformation.setSPCertEnc(spCertEnc); - } - - if (spAuthRequest != null) { - SPAuthRequest spAuthRequestElem = buildSPAuthRequest(spAuthRequest); - spInformation.setSPAuthRequest(spAuthRequestElem); - } - - return spInformation; - - } - - /** - * Builds VIDPAuthenticationAttributes objext - * @param ccc ISO citizen country code - * @param spIDString SPID - * @param sigCert SP signature certificate - * @param encCert SP encryption certificate - * @param spAuthRequest Original SP AuthnRequest - * @return VIDPAuthenticationAttributes - */ - public static VIDPAuthenticationAttributes buildVIDPAuthenticationAttributes(String ccc, String spIDString, X509Certificate sigCert, X509Certificate encCert, XMLObject spAuthRequest) { - VIDPAuthenticationAttributes vidpAuthenticationAttributes = buildXMLObject(VIDPAuthenticationAttributes.DEFAULT_ELEMENT_NAME); - - CitizenCountryCode citizenCountryCode = buildCitizenCountryCode(ccc); - SPInformation spInformation = buildSPInformation(spIDString, sigCert, encCert, spAuthRequest); - - vidpAuthenticationAttributes.setCitizenCountryCode(citizenCountryCode); - vidpAuthenticationAttributes.setSPInformation(spInformation); - - return vidpAuthenticationAttributes; - } - - /** - * Builds AuthenticationAttributes object - * @param ccc ISO citizen country code - * @param spIDString SPID - * @param sigCert SP signature certificate - * @param encCert SP encryption certificate - * @param spAuthRequest Original SP AuthnRequest - * @return AuthenticationAttributes - */ - public static AuthenticationAttributes buildAuthenticationAttributes(String ccc, String spIDString, X509Certificate sigCert, X509Certificate encCert, XMLObject spAuthRequest) { - AuthenticationAttributes authenticationAttributes = buildXMLObject(AuthenticationAttributes.DEFAULT_ELEMENT_NAME); - - VIDPAuthenticationAttributes vidpAuthenticationAttributes = buildVIDPAuthenticationAttributes(ccc, spIDString, sigCert, encCert, spAuthRequest); - - authenticationAttributes.setVIDPAuthenticationAttributes(vidpAuthenticationAttributes); - return authenticationAttributes; - - } - - /** - * Builds SpSector object - * @param spSector Value SPSector value - * @return SpSector - */ - public static SpSector buildSpSector(String spSectorValue) { - - SpSector spSector = buildXMLObject(SpSector.DEFAULT_ELEMENT_NAME); - spSector.setValue(spSectorValue); - - return spSector; - } - - /** - * Builds SpInstitution object - * @param spInstitutionValue Value for SpInstitution - * @return SpInstitution - */ - public static SpInstitution buildSpInstitution(String spInstitutionValue) { - - SpInstitution spInstitution = buildXMLObject(SpInstitution.DEFAULT_ELEMENT_NAME); - spInstitution.setValue(spInstitutionValue); - - return spInstitution; - } - - - /** - * Builds SpApplication object - * @param spApplicationValue Value for SpApplication - * @return SpApplication - */ - public static SpApplication buildSpApplication(String spApplicationValue) { - - SpApplication spApplication = buildXMLObject(SpApplication.DEFAULT_ELEMENT_NAME); - spApplication.setValue(spApplicationValue); - - return spApplication; - } - - /** - * Builds SpCountry object - * @param spCountryValue ISO Code Value for SpCountry - * @return SpCountry - */ - public static SpCountry buildSpCountry(String spCountryValue) { - - SpCountry spCountry = buildXMLObject(SpCountry.DEFAULT_ELEMENT_NAME); - spCountry.setValue(spCountryValue); - - return spCountry; - } - - /** - * Generates secured randomized ID for SAML Messages - * @return secured randomized ID - */ - public static String generateID() { - try { - IdentifierGenerator idGenerator = new SecureRandomIdentifierGenerator(); - return idGenerator.generateIdentifier(); - } catch (NoSuchAlgorithmException e) { - log.error("Cannot generate id", e); - throw new RuntimeException(e); - - } - - } - - /** - * Builds STORKAuthnRequest object - * @param destination Endpoint for AuthnRequest - * @param acsURL Endpoint where STORK response wants to be received - * @param providerName Provider Name - * @param issuerValue Value for Issuer element - * @param qaaLevel STORK QAALevel - * @param requestedAttributes Attributes to be requested - * @param spSector SPSector - * @param spInstitution SPInstitution - * @param spApplication SPApplication - * @param spCountry SPCountry - * @return STORKAuthnRequest - */ - public static STORKAuthnRequest buildSTORKAuthnRequest( - String destination, - String acsURL, - String providerName, - String issuerValue, - QualityAuthenticationAssuranceLevel qaaLevel, - RequestedAttributes requestedAttributes, - String spSector, - String spInstitution, - String spApplication, - String spCountry) { - - //fixed values - String consent = STORKAuthnRequest.UNSPECIFIED_CONSENT; - boolean forceAuthn = true; - boolean isPassive = false; - String binding = SAMLConstants.SAML2_POST_BINDING_URI; - boolean eIDSectorShare = true; - boolean eIDCrossSectorShare = true; - boolean eIDCrossBorderShare = false; - - STORKAuthnRequest authnRequest = buildXMLObject(STORKAuthnRequest.DEFAULT_ELEMENT_NAME); - - authnRequest.setVersion(SAMLVersion.VERSION_20); - authnRequest.setID(generateID()); - authnRequest.setIssueInstant(new DateTime()); - - authnRequest.setConsent(consent); - authnRequest.setForceAuthn(forceAuthn); - authnRequest.setIsPassive(isPassive); - authnRequest.setProtocolBinding(binding); - - authnRequest.setDestination(destination); - authnRequest.setAssertionConsumerServiceURL(acsURL); - authnRequest.setProviderName(providerName); - authnRequest.setIssuer(buildIssuer(issuerValue)); - - STORKExtensions extensions = buildSTORKExtensions(); - - authnRequest.setQAALevel(qaaLevel.getValue()); - extensions.setQAALevel(qaaLevel); - - authnRequest.setRequestedAttributes(requestedAttributes.getRequestedAttributes()); - extensions.setRequestedAttributes(requestedAttributes); - - EIDSectorShare eidSectorShareObj = buildXMLObject(EIDSectorShare.DEFAULT_ELEMENT_NAME); - eidSectorShareObj.setValue(eIDSectorShare); - - EIDCrossSectorShare eidCrossSectorShareObj = buildXMLObject(EIDCrossSectorShare.DEFAULT_ELEMENT_NAME); - eidCrossSectorShareObj.setValue(eIDCrossSectorShare); - - EIDCrossBorderShare eidCrossBorderShareObj = buildXMLObject(EIDCrossBorderShare.DEFAULT_ELEMENT_NAME); - eidCrossBorderShareObj.setValue(eIDCrossBorderShare); - - SpSector spSectorObj = buildSpSector(spSector); - SpInstitution spInstitutionObj = buildSpInstitution(spInstitution); - SpApplication spApplicationObj = buildSpApplication(spApplication); - SpCountry spCountryObj = buildSpCountry(spCountry); - - - extensions.getUnknownXMLObjects().add(qaaLevel); - extensions.getUnknownXMLObjects().add(spSectorObj); - extensions.getUnknownXMLObjects().add(spInstitutionObj); - extensions.getUnknownXMLObjects().add(spApplicationObj); - extensions.getUnknownXMLObjects().add(spCountryObj); - extensions.getUnknownXMLObjects().add(eidSectorShareObj); - extensions.getUnknownXMLObjects().add(eidCrossSectorShareObj); - extensions.getUnknownXMLObjects().add(eidCrossBorderShareObj); - extensions.getUnknownXMLObjects().add(requestedAttributes); - - authnRequest.setExtensions(extensions); - - return authnRequest; - } - - /** - * Builds STORKAuthnRequest object - * @param destination Endpoint for AuthnRequest - * @param acsURL Endpoint where STORK response wants to be received - * @param providerName Provider Name - * @param issuerValue Value for Issuer element - * @param qaaLevel STORK QAALevel - * @param requestedAttributeList List of STORK attributes to be requested - * @param ccc ISO citizen country code - * @param spIDString SPID - * @param sigCert SP signature certificate - * @param encCert SP encryption certificate - * @param spAuthRequest Original SP AuthnRequest - * @param spSector SPSector - * @param spInstitution SPInstitution - * @param spApplication SPApplication - * @param spCountry SPCountry - * @return STORKAuthnRequest - */ - public static STORKAuthnRequest buildSTORKAuthnRequest( - String destination, - String acsURL, - String providerName, - String issuerValue, - int qaaLevel, - List requestedAttributeList, - String ccc, - String spID, - X509Certificate sigCert, - X509Certificate encCert, - XMLObject spAuthRequest, - String spSector, - String spInstitution, - String spApplication, - String spCountry) { - - //fixed values via config - String consent = STORKAuthnRequest.UNSPECIFIED_CONSENT; - boolean forceAuthn = true; - boolean isPassive = false; - String binding = SAMLConstants.SAML2_POST_BINDING_URI; - boolean eIDSectorShare = true; - boolean eIDCrossSectorShare = true; - boolean eIDCrossBorderShare = false; - - return buildSTORKAuthnRequest(consent, forceAuthn, isPassive, binding, eIDSectorShare, eIDCrossSectorShare, eIDCrossBorderShare, destination, acsURL, providerName, issuerValue, qaaLevel, requestedAttributeList, ccc, spID, sigCert, encCert, spAuthRequest, spSector, spInstitution, spApplication, spCountry); - - } - - /** - * Builds STORKAuthnRequest object - * @param consent Consent for the request - * @param forceAuthn forceAuthn - * @param isPassive isPassive - * @param binding Binding the request is sent over - * @param eIDSectorShare Should eIdentifier be shared? - * @param eIDCrossSectorShare Should eIdentifier be shared across sectors? - * @param eIDCrossBorderShare Should eIdentifier be shared across borders? - * @param destination Endpoint for AuthnRequest - * @param acsURL Endpoint where STORK response wants to be received - * @param providerName Provider Name - * @param issuerValue Value for Issuer element - * @param qaaLevel STORK QAALevel - * @param requestedAttributeList List of STORK attributes to be requested - * @param ccc ISO citizen country code - * @param spIDString SPID - * @param sigCert SP signature certificate - * @param encCert SP encryption certificate - * @param spAuthRequest Original SP AuthnRequest - * @param spSector SPSector - * @param spInstitution SPInstitution - * @param spApplication SPApplication - * @param spCountry SPCountry - * @return STORKAuthnRequest - */ - public static STORKAuthnRequest buildSTORKAuthnRequest( - String consent, - boolean forceAuthn, - boolean isPassive, - String binding, - boolean eIDSectorShare, - boolean eIDCrossSectorShare, - boolean eIDCrossBorderShare, - String destination, - String acsURL, - String providerName, - String issuerValue, - int qaaLevel, - List requestedAttributeList, - String ccc, - String spID, - X509Certificate sigCert, - X509Certificate encCert, - XMLObject spAuthRequest, - String spSector, - String spInstitution, - String spApplication, - String spCountry) { - - STORKAuthnRequest authnRequest = buildXMLObject(STORKAuthnRequest.DEFAULT_ELEMENT_NAME); - - authnRequest.setVersion(SAMLVersion.VERSION_20); - authnRequest.setID(generateID()); - authnRequest.setIssueInstant(new DateTime()); - - authnRequest.setDestination(destination); - authnRequest.setAssertionConsumerServiceURL(acsURL); - authnRequest.setProviderName(providerName); - authnRequest.setIssuer(buildIssuer(issuerValue)); - authnRequest.setQAALevel(qaaLevel); - authnRequest.setRequestedAttributes(requestedAttributeList); - authnRequest.setCitizenCountryCode(ccc); - authnRequest.setSPID(spID); - authnRequest.setSPCertSig(sigCert); - authnRequest.setSPCertEnc(encCert); - authnRequest.setOriginalSPAuthRequest(spAuthRequest); - - authnRequest.setConsent(consent); - authnRequest.setForceAuthn(forceAuthn); - authnRequest.setIsPassive(isPassive); - authnRequest.setProtocolBinding(binding); - - addSTORKExtensionsToAuthnRequest(authnRequest, qaaLevel, requestedAttributeList, ccc, spID, sigCert, encCert, spAuthRequest, eIDSectorShare, eIDCrossSectorShare, eIDCrossBorderShare, spSector, spInstitution, spApplication, spCountry); - - return authnRequest; - - } - - /** - * Adds STORK Extensions to STORKAuthnRequest - * @param authnRequest - * @param qaaLevel STORK QAALevel - * @param requestedAttributeList List of STORK attributes to be requested - * @param ccc ISO citizen country code - * @param spIDString SPID - * @param sigCert SP signature certificate - * @param encCert SP encryption certificate - * @param spAuthRequest Original SP AuthnRequest - * @param spSector SPSector - * @param spInstitution SPInstitution - * @param spApplication SPApplication - * @param spCountry SPCountry - */ - public static void addSTORKExtensionsToAuthnRequest( - STORKAuthnRequest authnRequest, - int qaaLevel, - List requestedAttributeList, - String ccc, - String spID, - X509Certificate sigCert, - X509Certificate encCert, - XMLObject spAuthRequest, - boolean eIDSectorShare, - boolean eIDCrossSectorShare, - boolean eIDCrossBorderShare, - String spSector, - String spInstitution, - String spApplication, - String spCountry) { - - STORKExtensions extensions = buildSTORKExtensions(); - authnRequest.setRequestedAttributes(requestedAttributeList); - - QualityAuthenticationAssuranceLevel qaaLevelObj = buildQualityAuthenticationAssuranceLevel(qaaLevel); - RequestedAttributes requestedAttributesObj = buildRequestedAttributes(requestedAttributeList); - AuthenticationAttributes authenticationAttributesObj = buildAuthenticationAttributes(ccc, spID, sigCert, encCert, spAuthRequest); - - EIDSectorShare eidSectorShareObj = buildXMLObject(EIDSectorShare.DEFAULT_ELEMENT_NAME); - eidSectorShareObj.setValue(eIDSectorShare); - - EIDCrossSectorShare eidCrossSectorShareObj = buildXMLObject(EIDCrossSectorShare.DEFAULT_ELEMENT_NAME); - eidCrossSectorShareObj.setValue(eIDCrossSectorShare); - - EIDCrossBorderShare eidCrossBorderShareObj = buildXMLObject(EIDCrossBorderShare.DEFAULT_ELEMENT_NAME); - eidCrossBorderShareObj.setValue(eIDCrossBorderShare); - - SpSector spSectorObj = buildSpSector(spSector); - SpApplication spApplicationObj = buildSpApplication(spApplication); - SpCountry spCountryObj = buildSpCountry(spCountry); - - extensions.setQAALevel(qaaLevelObj); - extensions.setRequestedAttributes(requestedAttributesObj); - extensions.setAuthenticationAttributes(authenticationAttributesObj); - - extensions.getUnknownXMLObjects().add(qaaLevelObj); - extensions.getUnknownXMLObjects().add(spSectorObj); - extensions.getUnknownXMLObjects().add(spApplicationObj); - extensions.getUnknownXMLObjects().add(spCountryObj); - extensions.getUnknownXMLObjects().add(eidSectorShareObj); - extensions.getUnknownXMLObjects().add(eidCrossSectorShareObj); - extensions.getUnknownXMLObjects().add(eidCrossBorderShareObj); - extensions.getUnknownXMLObjects().add(requestedAttributesObj); - extensions.getUnknownXMLObjects().add(authenticationAttributesObj); - - authnRequest.setExtensions(extensions); - - } - - - /** - * Builds STORKExtensions object - * @return STORKExtensions - */ - public static STORKExtensions buildSTORKExtensions() { - QName samlProtocolExtensions = new QName(SAMLConstants.SAML20P_NS, STORKExtensions.LOCAL_NAME, SAMLConstants.SAML20P_PREFIX); - return buildXMLObject(samlProtocolExtensions); - } - - /** - * Builds STORKResponse - * @param destination Endpoint where the STORKResponse should be sent to - * @param inResponseTo ID of the corresponding AuthnRequest - * @param issuer Issuer value of the response - * @param status Status of the response (success, error, etc.) - * @param assertion SAML assertion to be included - * @return STORKResponse - */ - public static STORKResponse buildSTORKResponse( - String destination, - String inResponseTo, - Issuer issuer, - Status status, - Assertion assertion) { - - STORKResponse response = buildXMLObject(STORKResponse.DEFAULT_ELEMENT_NAME); - - response.setDestination(destination); - response.setInResponseTo(inResponseTo); - response.setConsent(STORKResponse.OBTAINED_CONSENT); - response.setID(generateID()); - response.setIssueInstant(new DateTime()); - response.setVersion(SAMLVersion.VERSION_20); - - response.setIssuer(issuer); - response.setStatus(status); - response.getAssertions().add(assertion); - - return response; - } - - /** - * Build STORKResponse - * @param destination Endpoint where the STORKResponse should be sent to - * @param inResponseTo ID of the corresponding AuthnRequest - * @param issuer Issuer value of the response - * @param status Status of the response (success, error, etc.) - * @param statusMessage Status message for the response - * @param assertion SAML assertion to be included - * @return STORKResponse - */ - public static STORKResponse buildSTORKResponse( - String destination, - String inResponseTo, - String issuerString, - String statusCode, - String statusMessage, - Assertion assertion) { - - Status status = buildStatus(statusCode, statusMessage); - Issuer issuer = buildIssuer(issuerString); - - return buildSTORKResponse(destination, inResponseTo, issuer, status, assertion); - } - - - /** - * Builds a STORKResponse containing no assertion - * @param destination Endpoint where the STORKResponse should be sent to - * @param inResponseTo ID of the corresponding AuthnRequest - * @param issuer Issuer value of the response - * @param status Status of the response (success, error, etc.) - * @param statusMessage Status message for the response - * @return STORKResponse - */ - public static STORKResponse buildSTORKErrorResponse( - String destination, - String inResponseTo, - String issuerString, - String statusCode, - String statusMessage) { - - return buildSTORKResponse(destination, inResponseTo, issuerString, statusCode, statusMessage, null); - } - - /** - * Builds Status object - * @param statusCodeValue StatusCode - * @param statusMessageValue StatusMessage - * @return Status - */ - public static Status buildStatus(String statusCodeValue, String statusMessageValue) { - return buildStatus(statusCodeValue, statusMessageValue, null); - } - - /** - * Builds Status object - * @param statusCodeValue StatusCode - * @param statusMessageValue StatusMessage - * @param detail Detail Message - * @return Status - */ - public static Status buildStatus(String statusCodeValue, String statusMessageValue, XMLObject detail) { - StatusCode statusCode = buildXMLObject(StatusCode.DEFAULT_ELEMENT_NAME); - statusCode.setValue(statusCodeValue); - - StatusMessage statusMessage = buildXMLObject(StatusMessage.DEFAULT_ELEMENT_NAME); - statusMessage.setMessage(statusMessageValue); - - StatusDetail statusDetail = buildXMLObject(StatusDetail.DEFAULT_ELEMENT_NAME); - statusDetail.getUnknownXMLObjects().add(detail); - - Status status = buildXMLObject(Status.DEFAULT_ELEMENT_NAME); - status.setStatusCode(statusCode); - status.setStatusMessage(statusMessage); - - return status; - - } - - /** - * Builds Assertion - * @param issuer Issuer value for assertion - * @param subject Subject of assertion - * @param conditions Conditions of assertion - * @param authnStatement AuthnStatement - * @param attributeStatement AttributeAtatement - * @return Assertion - */ - public static Assertion buildAssertion(Issuer issuer, - Subject subject, - Conditions conditions, - AuthnStatement authnStatement, - AttributeStatement attributeStatement) { - Assertion assertion = buildXMLObject(Assertion.DEFAULT_ELEMENT_NAME); - - assertion.setID(generateID()); - assertion.setVersion(SAMLVersion.VERSION_20); - assertion.setIssueInstant(new DateTime()); - - assertion.setIssuer(issuer); - assertion.setSubject(subject); - assertion.setConditions(conditions); - assertion.getAuthnStatements().add(authnStatement); - assertion.getAttributeStatements().add(attributeStatement); - - return assertion; - } - - /** - * Builds Assertion object - * @param issuerValue Value of the issuer - * @param nameQualifier nameQualifier - * @param spNameQualifier spNameQualifier - * @param spProviderID spProviderID - * @param ipAddress IP address of the client - * @param inResponseTo ID of the corresponding AuthnRequest - * @param notBefore Time before assertion is not valid - * @param notOnOrAfter Time after assertion is not valid - * @param recipient Recipient of the assertion - * @param attributeList Attributes to be included in the assertion - * @return Assertion - */ - public static Assertion buildAssertion( - String issuerValue, - String nameQualifier, - String spNameQualifier, - String spProviderID, - String ipAddress, - String inResponseTo, - DateTime notBefore, - DateTime notOnOrAfter, - String recipient, - List attributeList) { - - Issuer issuer = buildIssuer(issuerValue); - NameID nameID = buildNameID(NameID.UNSPECIFIED, nameQualifier, spNameQualifier, spProviderID, NameID.UNSPECIFIED); - SubjectConfirmationData scData = buildSubjectConfirmationData(ipAddress, inResponseTo, notOnOrAfter, recipient); - SubjectConfirmation subjectConfirmation = buildSubjectConfirmation(SubjectConfirmation.METHOD_BEARER, scData); - Subject subject = buildSubject(nameID, subjectConfirmation); - - List audienceList = buildAudienceList(recipient); - Conditions conditions = buildConditions(notBefore, notOnOrAfter, audienceList); - AuthnStatement authnStatement = buildAuthnStatement(ipAddress); - AttributeStatement attributeStatement = buildAttributeStatement(attributeList); - - return buildAssertion(issuer, subject, conditions, authnStatement, attributeStatement); - } - - /** - * Builds List of Audience objects - * @param audiences Audience strings - * @return List of Audience - */ - public static List buildAudienceList(String... audiences) { - List audienceList = new ArrayList(); - - for (String audienceString : audiences) { - Audience audience = buildXMLObject(Audience.DEFAULT_ELEMENT_NAME); - audience.setAudienceURI(audienceString); - audienceList.add(audience); - } - - return audienceList; - } - - /** - * Builds NameID object - * @param format Format of the NameID - * @param nameQualifier nameQualifier - * @param spNameQualifier spNameQualifier - * @param spProviderID spProviderID - * @param value Value of the NameID - * @return NameID - */ - public static NameID buildNameID(String format, - String nameQualifier, - String spNameQualifier, - String spProviderID, - String value) { - - NameID nameID = buildXMLObject(NameID.DEFAULT_ELEMENT_NAME); - - nameID.setFormat(format); - nameID.setNameQualifier(nameQualifier); - nameID.setSPNameQualifier(spNameQualifier); - nameID.setSPProvidedID(spProviderID); - nameID.setValue(value); - - return nameID; - - } - - /** - * Builds SubjectConfirmation object - * @param method Method of SubjectConfirmation - * @param scData SubjectConfirmationData - * @return SubjectConfirmation - */ - public static SubjectConfirmation buildSubjectConfirmation(String method, SubjectConfirmationData scData) { - - SubjectConfirmation subjectConfirmation = buildXMLObject(SubjectConfirmation.DEFAULT_ELEMENT_NAME); - - subjectConfirmation.setMethod(method); - subjectConfirmation.setSubjectConfirmationData(scData); - - return subjectConfirmation; - } - - /** - * Builds SubjectConfirmationData object - * @param ipAddress IP address of the client - * @param inResponseTo ID of the corresponding AuthnRequest - * @param notOnOrAfter Time after subject is not valid - * @param recipient recipient of the assertion - * @return SubjectConfirmationData - */ - public static SubjectConfirmationData buildSubjectConfirmationData(String ipAddress, - String inResponseTo, - DateTime notOnOrAfter, - String recipient) { - - SubjectConfirmationData scData = buildXMLObject(SubjectConfirmationData.DEFAULT_ELEMENT_NAME); - - scData.setAddress(ipAddress); - scData.setInResponseTo(inResponseTo); - scData.setNotOnOrAfter(notOnOrAfter); - scData.setRecipient(recipient); - - return scData; - - } - - /** - * Builds Subject object - * @param nameID NameID object - * @param subjectConfirmation SubjectConfirmation - * @return Subject - */ - public static Subject buildSubject(NameID nameID, SubjectConfirmation subjectConfirmation) { - - Subject subject = buildXMLObject(Subject.DEFAULT_ELEMENT_NAME); - subject.setNameID(nameID); - subject.getSubjectConfirmations().add(subjectConfirmation); - - return subject; - } - - /** - * Build Conditions object - * @param notBefore Time before assertion is not valid - * @param notOnOrAfter Time after assertion is not valid - * @param audienceList List of audience - * @return Conditions - */ - public static Conditions buildConditions(DateTime notBefore, DateTime notOnOrAfter, List audienceList) { - Conditions conditions = buildXMLObject(Conditions.DEFAULT_ELEMENT_NAME); - - conditions.setNotBefore(notBefore); - conditions.setNotOnOrAfter(notOnOrAfter); - - AudienceRestriction audienceRestriction = buildXMLObject(AudienceRestriction.DEFAULT_ELEMENT_NAME); - audienceRestriction.getAudiences().addAll(audienceList); - conditions.getAudienceRestrictions().add(audienceRestriction); - - OneTimeUse oneTimeUse = buildXMLObject(OneTimeUse.DEFAULT_ELEMENT_NAME); - conditions.getConditions().add(oneTimeUse); - - return conditions; - - } - - /** - * Build AuthnStatement object - * @param authInstant Time instant of authentication - * @param subjectLocality subjectLocality - * @param authnContext AuthnContext used - * @return AuthnStatement - */ - public static AuthnStatement buildAuthnStatement(DateTime authInstant, SubjectLocality subjectLocality, AuthnContext authnContext) { - AuthnStatement authnStatement = buildXMLObject(AuthnStatement.DEFAULT_ELEMENT_NAME); - - authnStatement.setAuthnInstant(authInstant); - authnStatement.setSubjectLocality(subjectLocality); - authnStatement.setAuthnContext(authnContext); - - return authnStatement; - } - - /** - * Build AuthnStatement object - * @param ipAddress IP address of the client - * @return AuthnStatement - */ - public static AuthnStatement buildAuthnStatement(String ipAddress) { - AuthnStatement authnStatement = buildXMLObject(AuthnStatement.DEFAULT_ELEMENT_NAME); - - authnStatement.setAuthnInstant(new DateTime()); - - SubjectLocality subjectLocality = buildXMLObject(SubjectLocality.DEFAULT_ELEMENT_NAME); - subjectLocality.setAddress(ipAddress); - authnStatement.setSubjectLocality(subjectLocality); - - AuthnContext authnContext = buildXMLObject(AuthnContext.DEFAULT_ELEMENT_NAME); - authnStatement.setAuthnContext(authnContext); - - return authnStatement; - } - - /** - * Builds AttributeStatement object - * @return AttributeStatement - */ - public static AttributeStatement buildAttributeStatement() { - return buildXMLObject(AttributeStatement.DEFAULT_ELEMENT_NAME); - } - - /** - * Builds AttributeStatement object - * @param attributeList List of attributes - * @return AttributeStatement - */ - public static AttributeStatement buildAttributeStatement(List attributeList) { - AttributeStatement attributeStatement = buildXMLObject(AttributeStatement.DEFAULT_ELEMENT_NAME); - attributeStatement.getAttributes().addAll(attributeList); - - return attributeStatement; - } - - /** - * Builds STORK String Attribute - * @param name Attribute Name - * @param friendlyName friendlyName of Attribute - * @param value Value of Attribute - * @param status STORK status of attribute - * @return STORK String Attribute - */ - public static Attribute buildSTORKStringAttribute(String name, String friendlyName, String value, String status) { - XSString xsString = buildXSString(AttributeValue.DEFAULT_ELEMENT_NAME); - xsString.setValue(value); - - return buildAttribute(name, friendlyName, status, xsString); - } - - /** - * Builds STORK XML Any Attribute - * @param name Attribute Name - * @param friendlyName friendlyName of Attribute - * @param value Value of Attribute - * @param status STORK status of attribute - * @return STORK XML Any Attribute - */ - public static Attribute buildSTORKXMLAttribute(String name, String friendlyName, XMLObject value, String status) { - XSAny xsAny = buildXMLObject(AttributeValue.DEFAULT_ELEMENT_NAME); - xsAny.getUnknownXMLObjects().add(value); - - return buildAttribute(name, friendlyName, status, xsAny); - } - - /** - * Builds STORK Attribute - * @param name Attribute Name - * @param friendlyName friendlyName of Attribute - * @param status STORK status of Attribute - * @param attributeValue Value of the Attribute - * @return Attribute - */ - public static Attribute buildAttribute(String name, String friendlyName, String status, XMLObject attributeValue) { - Attribute attribute = buildXMLObject(STORKAttribute.DEFAULT_ELEMENT_NAME); - - attribute.setNameFormat(STORKAttribute.URI_REFERENCE); - attribute.setFriendlyName(friendlyName); - attribute.setName(name); - attribute.getUnknownAttributes().put(STORKAttribute.DEFAULT_STORK_ATTRIBUTE_QNAME, status); - attribute.getAttributeValues().add(attributeValue); - - return attribute; - } - - /** - * Builds STORK String Attribute - * @param name Attribute Name - * @param friendlyName friendlyName of Attribute - * @param status STORK status of Attribute - * @param attributeValue Value of the Attribute - * @return String Attribute - */ - public static Attribute buildStringAttribute(String name, String friendlyName, String status, String attributeValue) { - Attribute attribute = buildXMLObject(STORKAttribute.DEFAULT_ELEMENT_NAME); - - attribute.setNameFormat(STORKAttribute.URI_REFERENCE); - attribute.setFriendlyName(friendlyName); - attribute.setName(name); - attribute.getUnknownAttributes().put(STORKAttribute.DEFAULT_STORK_ATTRIBUTE_QNAME, status); - - XSString xsString = buildXSString(AttributeValue.DEFAULT_ELEMENT_NAME); - xsString.setValue(attributeValue); - attribute.getAttributeValues().add(xsString); - - return attribute; - } - - /** - * Builds DSS signature request - * @param textToBeSigned Text to be included in the DSS request - * @param mimeType MimeType of the contents - * @return DSS signature request as String - */ - public static String buildSignatureRequestString(String textToBeSigned, String mimeType) { - //MimeType=\"text/plain\" - //MimeType=\"application/xhtml+xml\" - String sigRequestString = - "" + - "" + - "" + - "" + Base64.encodeBytes(textToBeSigned.getBytes()) + "" + - "" + - "" + - ""; - - return sigRequestString; - - } - - /** - * Builds STORK signedDoc RequestedAttribute - * @param textToBeSigned Text to be included in the DSS request - * @param mimeType MimeType of the contents - * @param isRequired true or false if signedDoc RequestedAttribute is required - * @return STORK signedDoc RequestedAttribute - */ - public static RequestedAttribute buildSignatureRequestRequestedAttribute(String textToBeSigned, String mimeType, boolean isRequired) { - return buildRequestedAttribute(STORKConstants.STORK_ATTRIBUTE_SIGNEDDOC, isRequired, buildSignatureRequestString(textToBeSigned, mimeType)); - } - - /** - * Adds RequestedAttribute to STORKAuthnRequest - * @param authnRequest STORKAuthnRequest - * @param reqAttr RequestedAttribute - */ - public static void addRequestedAttribute(STORKAuthnRequest authnRequest, RequestedAttribute reqAttr) { - if (authnRequest != null) { - RequestedAttributes requestedAttributes = (RequestedAttributes) authnRequest.getExtensions().getUnknownXMLObjects(RequestedAttributes.DEFAULT_ELEMENT_NAME).get(0); - requestedAttributes.getRequestedAttributes().add(reqAttr); - } - } - - /** - * Adds several RequestedAttribute to STORKAuthnRequest - * @param authnRequest STORKAuthnRequest - * @param reqAttr RequestedAttribute - */ - public static void addRequestedAttributes(STORKAuthnRequest authnRequest, RequestedAttribute... reqAttrs) { - for (RequestedAttribute reqAttr : reqAttrs) { - addRequestedAttribute(authnRequest, reqAttr); - } - } - - /** - * Builds STORK signed doc attribute and adds it to STORKAuthnRequest - * @param authnRequest STORKAuthnRequest - * @param textToBeSigned Text to be included in the DSS request - * @param mimeType MimeType of the contents - * @param isRequired true or false if signedDoc RequestedAttribute is required - */ - public static void buildAndAddSignatureRequestToAuthnRequest(STORKAuthnRequest authnRequest, String textToBeSigned, String mimeType, boolean isRequired) { - if (authnRequest != null && !StringUtils.isEmpty(textToBeSigned)) { - addRequestedAttribute(authnRequest, buildSignatureRequestRequestedAttribute(textToBeSigned, mimeType, isRequired)); - } - - } - - /** - * Adds DSS siganture request as String to STORKAuthnRequest - * @param authnRequest STORKAuthnRequest - * @param dssSignatureRequest DSS signature request as String - * @param isRequired true or false if signedDoc RequestedAttribute is required - */ - public static void addSignatureRequestToAuthnRequest(STORKAuthnRequest authnRequest, String dssSignatureRequest, boolean isRequired) { - if (authnRequest != null && !StringUtils.isEmpty(dssSignatureRequest)) { - addRequestedAttribute(authnRequest, buildRequestedAttribute(STORKConstants.STORK_ATTRIBUTE_SIGNEDDOC, isRequired, dssSignatureRequest)); - } - - } - - /** - * Adds Attribute to an assertion - * @param assertion Assertion - * @param attr Attribute - */ - public static void addAttribute(Assertion assertion, Attribute attr) { - if (assertion != null) { - if (!assertion.getAttributeStatements().isEmpty()) { - assertion.getAttributeStatements().get(0).getAttributes().add(attr); - } - } - } - - /** - * Adds several Attribute to an assertion - * @param assertion Assertion - * @param attr Attribute - */ - public static void addAttributes(Assertion assertion, Attribute... attrs) { - for (Attribute attr : attrs) { - addAttribute(assertion, attr); - } - } - - /** - * Adds several Attribute to first assertion in STORK response - * @param response STORK response - * @param attrs Attribute - */ - public static void addAttribute(STORKResponse response, Attribute... attrs) { - if (response != null) { - if (!response.getAssertions().isEmpty()) { - addAttributes(response.getAssertions().get(0), attrs); - } - } - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/common/STORKBootstrap.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/common/STORKBootstrap.java deleted file mode 100644 index 953affdf8..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/common/STORKBootstrap.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.common; - -import java.io.InputStream; - -import org.opensaml.DefaultBootstrap; -import org.opensaml.common.xml.SAMLSchemaBuilder; -import org.opensaml.xml.ConfigurationException; -import org.opensaml.xml.XMLConfigurator; - -/** - * Class extending the default bootstrap mechanism of OpenSAML - * @author bzwattendorfer - * - */ -public class STORKBootstrap extends DefaultBootstrap { - - /** - * Extends the default bootstrap mechanism of OpenSAML - * Adds STORK schemata and extension elements - * @throws ConfigurationException - */ - public static synchronized void bootstrap() throws ConfigurationException { - - DefaultBootstrap.bootstrap(); - - SAMLSchemaBuilder.addExtensionSchema("stork-schema-assertion-1.0.xsd"); - SAMLSchemaBuilder.addExtensionSchema("stork-schema-protocol-1.0.xsd"); - - - - initStorkConfig("saml2-stork-config.xml"); - - } - - /** - * Initializes OpenSAML with config - * @param xmlConfig XML Config for STORK and SAML2 - * @throws ConfigurationException - */ - private static void initStorkConfig(String xmlConfig) throws ConfigurationException { - - XMLConfigurator configurator = new XMLConfigurator(); - - InputStream is = STORKBootstrap.class.getClassLoader().getResourceAsStream(xmlConfig); - - configurator.load(is); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/common/STORKConstants.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/common/STORKConstants.java deleted file mode 100644 index 5a63e2dcd..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/common/STORKConstants.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.common; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** - * Interface encapuslating relevant STORK constants such as namespace, attribute names, etc. - * @author bzwattendorfer - * - */ -public interface STORKConstants { - - /** - * STORK namespace - */ - public static final String STORK10_NS = "urn:eu:stork:names:tc:STORK:1.0:assertion"; - - /** - * STORK namespace prefix - */ - public static final String STORK10_PREFIX = "stork"; - - /** - * STORK protocol namespace - */ - public static final String STORKP10_NS = "urn:eu:stork:names:tc:STORK:1.0:protocol"; - - /** - * STORK protocol namespace prefix - */ - public static final String STORKP10_PREFIX = "storkp"; - - /** - * STORK attribute name prefix - */ - final static String STORK_ATTRIBUTE_NAME_PREFIX = "http://www.stork.gov.eu/1.0/"; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_EIDENTIFIER = "eIdentifier"; - final static String STORK_ATTRIBUTE_EIDENTIFIER = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_EIDENTIFIER; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_GIVENAME = "givenName"; - final static String STORK_ATTRIBUTE_GIVENNAME = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_GIVENAME; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_SURNAME = "surname"; - final static String STORK_ATTRIBUTE_SURNAME = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_SURNAME; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_INHERITED_FAMILYNAME = "inheritedFamilyName"; - final static String STORK_ATTRIBUTE_INHERITED_FAMILYNAME = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_INHERITED_FAMILYNAME; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_ADOPTED_FAMILYNAME = "adoptedFamilyName"; - final static String STORK_ATTRIBUTE_ADOPTED_FAMILYNAME = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_ADOPTED_FAMILYNAME; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_GENDER = "gender"; - final static String STORK_ATTRIBUTE_GENDER = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_GENDER; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_DATEOFBIRTH = "dateOfBirth"; - final static String STORK_ATTRIBUTE_DATEOFBIRTH = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_DATEOFBIRTH; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_COUNTRYOFBIRTH = "countryCodeOfBirth"; - final static String STORK_ATTRIBUTE_COUNTRYCODEOFBIRTH = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_COUNTRYOFBIRTH; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_NATIONALITYCODE = "nationalityCode"; - final static String STORK_ATTRIBUTE_NATIONALITYCODE = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_NATIONALITYCODE; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_MARTIALSTATUS = "maritalStatus"; - final static String STORK_ATTRIBUTE_MARTIALSTATUS = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_MARTIALSTATUS; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_TEXT_RESIDENCE_ADDRESS = "textResidenceAddress"; - final static String STORK_ATTRIBUTE_TEXT_RESIDENCE_ADDRESS = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_TEXT_RESIDENCE_ADDRESS; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_CANONICAL_RESIDENCE_ADDRESS = "canonicalResidenceAddress"; - final static String STORK_ATTRIBUTE_TEXT_CANONICAL_ADDRESS = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_CANONICAL_RESIDENCE_ADDRESS; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_EMAIL = "eMail"; - final static String STORK_ATTRIBUTE_EMAIL = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_EMAIL; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_TITLE = "title"; - final static String STORK_ATTRIBUTE_TITLE = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_TITLE; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_RESIDENCE_PERMIT = "residencePermit"; - final static String STORK_ATTRIBUTE_RESIDENCE_PERMIT = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_RESIDENCE_PERMIT; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_PSEUDONYM = "pseudonym"; - final static String STORK_ATTRIBUTE_PSEUDONYM = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_PSEUDONYM; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_AGE = "age"; - final static String STORK_ATTRIBUTE_AGE = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_AGE; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_ISAGEOVER = "isAgeOver"; - final static String STORK_ATTRIBUTE_ISAGEOVER = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_ISAGEOVER; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_SIGNED_DOC = "signedDoc"; - final static String STORK_ATTRIBUTE_SIGNEDDOC = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_SIGNED_DOC; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_FISCALNUMBER = "fiscalNumber"; - final static String STORK_ATTRIBUTE_FISCALNUMBER = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_FISCALNUMBER; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_CITIZENQAALEVEL_OLD = "citizenQAAlevel"; - final static String STORK_ATTRIBUTE_CITIZENQAALEVEL_OLD = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_CITIZENQAALEVEL_OLD; - - final static String STORK_ATTRIBUTE_NAME_SUFFIX_CITIZENQAALEVEL = "citizenQAALevel"; - final static String STORK_ATTRIBUTE_CITIZENQAALEVEL = STORK_ATTRIBUTE_NAME_PREFIX + STORK_ATTRIBUTE_NAME_SUFFIX_CITIZENQAALEVEL; - - /** - * Full Set of accepted STORK attributes - */ - public final Set FULL_STORK_ATTRIBUTE_SET = new HashSet(Arrays.asList(new String[] {STORK_ATTRIBUTE_EIDENTIFIER, - STORK_ATTRIBUTE_GIVENNAME, - STORK_ATTRIBUTE_SURNAME, - STORK_ATTRIBUTE_INHERITED_FAMILYNAME, - STORK_ATTRIBUTE_ADOPTED_FAMILYNAME, - STORK_ATTRIBUTE_GENDER, - STORK_ATTRIBUTE_DATEOFBIRTH, - STORK_ATTRIBUTE_COUNTRYCODEOFBIRTH, - STORK_ATTRIBUTE_NATIONALITYCODE, - STORK_ATTRIBUTE_MARTIALSTATUS, - STORK_ATTRIBUTE_TEXT_RESIDENCE_ADDRESS, - STORK_ATTRIBUTE_TEXT_CANONICAL_ADDRESS, - STORK_ATTRIBUTE_TEXT_CANONICAL_ADDRESS, - STORK_ATTRIBUTE_EMAIL, - STORK_ATTRIBUTE_TITLE, - STORK_ATTRIBUTE_RESIDENCE_PERMIT, - STORK_ATTRIBUTE_PSEUDONYM, - STORK_ATTRIBUTE_AGE, - STORK_ATTRIBUTE_ISAGEOVER, - STORK_ATTRIBUTE_SIGNEDDOC, - STORK_ATTRIBUTE_FISCALNUMBER, - STORK_ATTRIBUTE_CITIZENQAALEVEL_OLD, - STORK_ATTRIBUTE_CITIZENQAALEVEL})); - - /** - * Default set of STORK attributes to be requested (without signedDoc) - */ - Set DEFAULT_STORK_REQUESTED_ATTRIBUTE_SET = new HashSet(Arrays.asList(new String[] { - STORK_ATTRIBUTE_EIDENTIFIER, - STORK_ATTRIBUTE_GIVENNAME, - STORK_ATTRIBUTE_SURNAME, - STORK_ATTRIBUTE_DATEOFBIRTH,})); - - /** - * Default required set of returned STORK attributes - */ - Set DEFAULT_STORK_RETURNED_ATTRIBUTE_SET = new HashSet(Arrays.asList(new String[] { - STORK_ATTRIBUTE_EIDENTIFIER, - STORK_ATTRIBUTE_GIVENNAME, - STORK_ATTRIBUTE_SURNAME, - STORK_ATTRIBUTE_DATEOFBIRTH, - STORK_ATTRIBUTE_SIGNEDDOC})); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/exception/SAMLException.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/exception/SAMLException.java deleted file mode 100644 index 33ee67313..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/exception/SAMLException.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.exception; - -/** - * Exception thrown if exception occurs in SAML message processing - * @author bzwattendorfer - * - */ -public class SAMLException extends Exception { - - /** {@inheritDoc} */ - public SAMLException() { - super(); - } - - /** {@inheritDoc} */ - public SAMLException(String message, Throwable cause) { - super(message, cause); - } - - /** {@inheritDoc} */ - public SAMLException(String message) { - super(message); - } - - /** {@inheritDoc} */ - public SAMLException(Throwable cause) { - super(cause); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/exception/SAMLValidationException.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/exception/SAMLValidationException.java deleted file mode 100644 index 51520d968..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/exception/SAMLValidationException.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.exception; - -/** - * Exception thrown if error occurs in SAML message validation - * @author bzwattendorfer - * - */ -public class SAMLValidationException extends Exception { - - private static final long serialVersionUID = 1L; - - /** {@inheritDoc} */ - public SAMLValidationException() { - - super(); - } - - /** {@inheritDoc} */ - public SAMLValidationException(String s) { - - super(s); - } - - /** {@inheritDoc} */ - public SAMLValidationException(Exception e) { - - super(e); - } - - /** {@inheritDoc} */ - public SAMLValidationException(String m, Exception e) { - - super(m, e); - } -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKAttribute.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKAttribute.java deleted file mode 100644 index ec8232704..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKAttribute.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.saml; - -import javax.xml.namespace.QName; - -import org.opensaml.saml2.core.Attribute; - -import eu.stork.vidp.messages.common.STORKConstants; - -/** - * Interface extending original SAML Attribute for STORK with the XML attributeStatus attribute - * {@inheritDoc} - * @author bzwattendorfer - * - */ -public interface STORKAttribute extends Attribute { - - public static final String STORK_ATTRIBUTE_STATUS_ATTTRIB_NAME = "AttributeStatus"; - - public static final QName DEFAULT_STORK_ATTRIBUTE_QNAME = new QName(STORKConstants.STORK10_NS, STORK_ATTRIBUTE_STATUS_ATTTRIB_NAME, STORKConstants.STORK10_PREFIX); - - public static final String ALLOWED_ATTRIBUTE_STATUS_AVAIL = "Available"; - public static final String ALLOWED_ATTRIBUTE_STATUS_NOT_AVAIL = "NotAvailable"; - public static final String ALLOWED_ATTRIBUTE_STATUS_WITHHELD = "Withheld"; - - /** - * Sets the STORK attributeStatus - * @param attributeStatus - */ - public void setAttributeStatus(String attributeStatus); - - /** - * Gets the STORK attributeStatus - * @return - */ - public String getAttributeStatus(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKAttributeValue.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKAttributeValue.java deleted file mode 100644 index 2d511d62a..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKAttributeValue.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.saml; - -import javax.xml.namespace.QName; - -import org.opensaml.saml2.core.AttributeValue; - -import eu.stork.vidp.messages.common.STORKConstants; - -/** - * {@inheritDoc} - * @author bzwattendorfer - * - */ -public interface STORKAttributeValue extends AttributeValue { - - /** Element name, no namespace. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AttributeValue"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORK10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKExtensions.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKExtensions.java deleted file mode 100644 index b5e12ea75..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKExtensions.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml; - -import org.opensaml.saml2.common.Extensions; - -import eu.stork.vidp.messages.stork.AuthenticationAttributes; -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; -import eu.stork.vidp.messages.stork.RequestedAttributes; - -/** - * Extends the SAML Extension element with STORK related functionality - * {@inheritDoc} - * @author bzwattendorfer - * - */ -public interface STORKExtensions extends Extensions { - - /** - * Sets the QAALevel object - * @param authLevel QAALevel object - */ - public void setQAALevel(QualityAuthenticationAssuranceLevel authLevel); - - /** - * Gets the QAALevel object - * @return QAALevel object - */ - public QualityAuthenticationAssuranceLevel getQAALevel(); - - /** - * Gets the RequestedAttributes object - * @return RequestedAttributes object - */ - public RequestedAttributes getRequestedAttributes(); - - /** - * Sets RequestedAttributes - * @param requestedAttributes RequestedAttributes object - */ - public void setRequestedAttributes(RequestedAttributes requestedAttributes); - - /** - * Gets AuthenticationAttributes - * @return AuthenticationAttributes - */ - public AuthenticationAttributes getAuthenticationAttributes(); - - /** - * Sets AuthenticationAttributes - * @param authenticationAttributes AuthenticationAttributes object - */ - public void setAuthenticationAttributes(AuthenticationAttributes authenticationAttributes); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKRequestedAttribute.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKRequestedAttribute.java deleted file mode 100644 index 38149bea5..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/STORKRequestedAttribute.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.saml; - -import javax.xml.namespace.QName; - -import org.opensaml.saml2.metadata.RequestedAttribute; - -import eu.stork.vidp.messages.common.STORKConstants; - -/** - * {@inheritDoc} - * @author bzwattendorfer - * - */ -public interface STORKRequestedAttribute extends RequestedAttribute { - - - /** Default element name */ - public final static QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORK10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - - /** QName of the XSI type */ - public final static QName TYPE_NAME = new QName(STORKConstants.STORK10_NS, TYPE_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeBuilder.java deleted file mode 100644 index 413b5f6d7..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeBuilder.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.common.xml.SAMLConstants; -import org.opensaml.saml2.core.Attribute; -import org.opensaml.saml2.core.impl.AttributeBuilder; - -import eu.stork.vidp.messages.saml.STORKAttribute; - -/** - * @author bzwattendorfer - * - */ -public class STORKAttributeBuilder extends AttributeBuilder { - - /** - * Constructor. - */ - public STORKAttributeBuilder() { - - } - - /** {@inheritDoc} */ - public STORKAttribute buildObject() { - return buildObject(SAMLConstants.SAML20_NS, Attribute.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX); - } - - /** {@inheritDoc} */ - public STORKAttribute buildObject(String namespaceURI, String localName, String namespacePrefix) { - return new STORKAttributeImpl(namespaceURI, localName, namespacePrefix); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeImpl.java deleted file mode 100644 index 89ad90eae..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.saml2.core.impl.AttributeImpl; - -import eu.stork.vidp.messages.saml.STORKAttribute; - -/** - * @author bzwattendorfer - * - */ -public class STORKAttributeImpl extends AttributeImpl implements STORKAttribute { - - private String attributeStatus; - - protected STORKAttributeImpl(String namespaceURI, String elementLocalName, - String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - /* (non-Javadoc) - * @see eu.stork.mw.common.messages.saml.STORKAttribute#getAttributeStatus() - */ - public String getAttributeStatus() { - return attributeStatus; - } - - /* (non-Javadoc) - * @see eu.stork.mw.common.messages.saml.STORKAttribute#setAttributeStatus(java.lang.String) - */ - public void setAttributeStatus(String attributeStatus) { - this.attributeStatus = attributeStatus; - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeMarshaller.java deleted file mode 100644 index ba8c2f1a3..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeMarshaller.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.saml2.core.impl.AttributeMarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.MarshallingException; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.saml.STORKAttribute; - -/** - * @author bzwattendorfer - * - */ -public class STORKAttributeMarshaller extends AttributeMarshaller { - - protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { - STORKAttribute attribute = (STORKAttribute) samlElement; - - if (attribute.getAttributeStatus() != null) { - domElement.setAttributeNS(STORKConstants.STORK10_NS, STORKAttribute.STORK_ATTRIBUTE_STATUS_ATTTRIB_NAME, attribute.getName()); - } - - super.marshallAttributes(samlElement, domElement); - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeUnmarshaller.java deleted file mode 100644 index 5a74dab7d..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAttributeUnmarshaller.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - - -package eu.stork.vidp.messages.saml.impl; - -import javax.xml.namespace.QName; - -import org.opensaml.saml2.core.Attribute; -import org.opensaml.saml2.core.impl.AttributeUnmarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.UnmarshallingException; -import org.w3c.dom.Attr; - -import eu.stork.vidp.messages.saml.STORKAttribute; - -/** - * A thread-safe Unmarshaller for {@link org.opensaml.saml2.core.Attribute} objects. - */ -public class STORKAttributeUnmarshaller extends AttributeUnmarshaller { - - - protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { - - if (samlObject instanceof STORKAttribute) { - STORKAttribute attrib = (STORKAttribute) samlObject; - - if (attribute.getLocalName().equals(STORKAttribute.STORK_ATTRIBUTE_STATUS_ATTTRIB_NAME)) { - attrib.setAttributeStatus(attribute.getValue()); - } - } - - super.processAttribute(samlObject, attribute); - } - -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestBuilder.java deleted file mode 100644 index 8836b6c8e..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.common.xml.SAMLConstants; -import org.opensaml.saml2.core.AuthnRequest; -import org.opensaml.saml2.core.impl.AuthnRequestBuilder; - -import eu.stork.mw.messages.saml.STORKAuthnRequest; - -public class STORKAuthnRequestBuilder extends AuthnRequestBuilder { - - /** {@inheritDoc} */ - - - public STORKAuthnRequest buildObject() { - return buildObject(SAMLConstants.SAML20P_NS, AuthnRequest.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX); - } - - /** {@inheritDoc} */ - public STORKAuthnRequest buildObject(String namespaceURI, String localName, String namespacePrefix) { - return new STORKAuthnRequestImpl(namespaceURI, localName, namespacePrefix); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestImpl.java deleted file mode 100644 index c9375ceb9..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import java.security.cert.X509Certificate; -import java.util.List; - -import org.opensaml.common.xml.SAMLConstants; -import org.opensaml.saml2.core.impl.AuthnRequestImpl; -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.xml.XMLObject; - -import eu.stork.mw.messages.saml.STORKAuthnRequest; - -public class STORKAuthnRequestImpl extends AuthnRequestImpl implements STORKAuthnRequest { - - private int qaaLevel; - - private String ccc; - - private String finalRedirectURL; - - private String spID; - - private XMLObject originalSPAuthRequest; - - private X509Certificate spCertSig; - - private X509Certificate spCertEnc; - - //private XMLObjectChildrenList requestedAttributes; - private List requestedAttributes; - - protected STORKAuthnRequestImpl(String namespaceURI, String elementLocalName, - String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - //requestedAttributes = new IndexedXMLObjectChildrenList(this); - } - - public STORKAuthnRequestImpl() { - super(SAMLConstants.SAML20P_NS, STORKAuthnRequest.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX); - } - - - - public int getQAALevel() { - return this.qaaLevel; - } - - public void setQAALevel(int authLevel) { - this.qaaLevel = authLevel; - - } - - public String getCitizenCountryCode() { - return ccc; - } - - public String getFinalRedirectURL() { - return finalRedirectURL; - } - - public XMLObject getOriginalSPAuthRequest() { - return originalSPAuthRequest; - } - - public X509Certificate getSPCertEnc() { - return spCertEnc; - } - - public X509Certificate getSPCertSig() { - return spCertSig; - } - - public String getSPID() { - return spID; - } - - public void setCitizenCountryCode(String citizenCountryCode) { - this.ccc = citizenCountryCode; - } - - public void setFinalRedirectURL(String finalRedirectURL) { - this.finalRedirectURL = finalRedirectURL; - } - - public void setOriginalSPAuthRequest(XMLObject spAuthRequest) { - this.originalSPAuthRequest = spAuthRequest; - } - - public void setSPCertEnc(X509Certificate encryptionCertificate) { - this.spCertEnc = encryptionCertificate; - } - - public void setSPCertSig(X509Certificate signingCertificate) { - this.spCertSig = signingCertificate; - } - - public void setSPID(String spID) { - this.spID = spID; - } - - public List getRequestedAttributes() { -// return (List) requestedAttributes.subList(new QName(STORKMessagesConstants.STORK10_NS, DEFAULT_ELEMENT_LOCAL_NAME, STORKMessagesConstants.STORK10_PREFIX)); - return requestedAttributes; - } - - public void setRequestedAttributes(List requestedAttributesList) { - // this.requestedAttributes = (XMLObjectChildrenList) requestedAttributesList; - this.requestedAttributes = requestedAttributesList; - } - -// public List getOrderedChildren() { -// ArrayList children = new ArrayList(); -// -// if (super.getOrderedChildren() != null) { -// children.addAll(super.getOrderedChildren()); -// } -// -// if (qaaLevel != 0 ) { -// children.add(subject); -// } -// -// if (nameIDPolicy != null) { -// children.add(nameIDPolicy); -// } -// -// if (conditions != null) { -// children.add(conditions); -// } -// -// if (requestedAuthnContext != null) { -// children.add(requestedAuthnContext); -// } -// -// if (scoping != null) { -// children.add(scoping); -// } -// -// if (children.size() == 0) { -// return null; -// } -// -// return Collections.unmodifiableList(children); -// } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestMarshaller.java deleted file mode 100644 index faad3a835..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestMarshaller.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.saml2.core.impl.AuthnRequestMarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.MarshallingException; -import org.w3c.dom.Element; - -import eu.stork.mw.messages.saml.STORKAuthnRequest; - -public class STORKAuthnRequestMarshaller extends AuthnRequestMarshaller { - - protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException { - STORKAuthnRequest req = (STORKAuthnRequest) samlObject; - -// if (sr.getQAA() != -1) { -// //domElement.setAttributeNS(null, StatusResponseType.VERSION_ATTRIB_NAME, sr.getVersion().toString()); -// } - } -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestUnmarshaller.java deleted file mode 100644 index 7924400fa..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKAuthnRequestUnmarshaller.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; - -import org.opensaml.saml2.core.impl.AuthnRequestUnmarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.UnmarshallingException; -import org.opensaml.xml.signature.X509Data; -import org.opensaml.xml.util.Base64; - -import eu.stork.mw.messages.saml.STORKAuthnRequest; -import eu.stork.vidp.messages.saml.STORKExtensions; -import eu.stork.vidp.messages.stork.SPCertEnc; -import eu.stork.vidp.messages.stork.SPCertSig; -import eu.stork.vidp.messages.stork.SPCertType; -import eu.stork.vidp.messages.stork.SPInformation; -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -public class STORKAuthnRequestUnmarshaller extends AuthnRequestUnmarshaller { - - protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) - throws UnmarshallingException { - STORKAuthnRequest req = (STORKAuthnRequest) parentSAMLObject; - - if (childSAMLObject instanceof STORKExtensions) { - STORKExtensions ext = (STORKExtensions) childSAMLObject; - req.setExtensions(ext); - - if (ext.getQAALevel() != null) - req.setQAALevel(ext.getQAALevel().getValue()); - - if (ext.getRequestedAttributes() != null) { - //List reqAttrList = new ArrayList(); -// for (RequestedAttribute reqAtt : ext.getRequestedAttributes().getRequestedAttributes()) { -// req.getRequestedAttributes().add(reqAtt); -// } - req.setRequestedAttributes(ext.getRequestedAttributes().getRequestedAttributes()); - - } - - if (ext.getAuthenticationAttributes() != null) { - VIDPAuthenticationAttributes vidpAuthAttributes = ext.getAuthenticationAttributes().getVIDPAuthenticationAttributes(); - if (vidpAuthAttributes != null) { - if (vidpAuthAttributes.getCitizenCountryCode() != null) - req.setCitizenCountryCode(vidpAuthAttributes.getCitizenCountryCode().getValue()); - - SPInformation spInformation = vidpAuthAttributes.getSPInformation(); - if (spInformation != null) { - if (spInformation.getSPID() != null) - req.setSPID(spInformation.getSPID().getValue()); - - if (spInformation.getSPCertSig() != null) { - SPCertSig spCertSig = spInformation.getSPCertSig(); - try { - req.setSPCertSig(getCertificateFromX509Data(spCertSig)); - } catch (Exception e) { - throw new UnmarshallingException("Error reading SP signing certificate"); - } - } - - if (spInformation.getSPCertEnc() != null) { - SPCertEnc spCertEnc = spInformation.getSPCertEnc(); - try { - req.setSPCertEnc(getCertificateFromX509Data(spCertEnc)); - } catch (Exception e) { - throw new UnmarshallingException("Error reading SP encryption certificate"); - } - } - - if (spInformation.getSPAuthRequest() != null) { - req.setOriginalSPAuthRequest(spInformation.getSPAuthRequest()); - } - - } - } - } - - } else { - super.processChildElement(parentSAMLObject, childSAMLObject); - } - } - - private X509Certificate getCertificateFromX509Data(SPCertType spCert) throws CertificateException { - if (spCert.getKeyInfo() != null) - if (!spCert.getKeyInfo().getX509Datas().isEmpty()) { - X509Data samlX509Data = spCert.getKeyInfo().getX509Datas().get(0); - - if (samlX509Data != null) { - if (!samlX509Data.getX509Certificates().isEmpty()) { - org.opensaml.xml.signature.X509Certificate samlX509Cert = samlX509Data.getX509Certificates().get(0); - if (samlX509Cert != null) { - if (samlX509Cert.getValue() != null && samlX509Cert.getValue().length() != 0) { - InputStream inStream = new ByteArrayInputStream( Base64.decode(samlX509Cert.getValue())); - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream); - return cert; - } - - } - - } - } - } - - return null; - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsBuilder.java deleted file mode 100644 index 96004871c..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.common.xml.SAMLConstants; -import org.opensaml.saml2.common.impl.ExtensionsBuilder; -import org.opensaml.saml2.core.Response; - -import eu.stork.vidp.messages.saml.STORKExtensions; - -public class STORKExtensionsBuilder extends ExtensionsBuilder { - - public STORKExtensions buildObject() { - return buildObject(SAMLConstants.SAML20P_NS, Response.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX); - } - - /** {@inheritDoc} */ - public STORKExtensions buildObject(String namespaceURI, String localName, String namespacePrefix) { - return new STORKExtensionsImpl(namespaceURI, localName, namespacePrefix); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsImpl.java deleted file mode 100644 index 5417481c7..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.saml2.common.impl.ExtensionsImpl; - -import eu.stork.vidp.messages.saml.STORKExtensions; -import eu.stork.vidp.messages.stork.AuthenticationAttributes; -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; -import eu.stork.vidp.messages.stork.RequestedAttributes; - -public class STORKExtensionsImpl extends ExtensionsImpl implements STORKExtensions { - - private QualityAuthenticationAssuranceLevel qaaLevel; - - private RequestedAttributes requestedAttributes; - - private AuthenticationAttributes authenticationAttributes; - - protected STORKExtensionsImpl(String namespaceURI, String elementLocalName, - String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public AuthenticationAttributes getAuthenticationAttributes() { - return authenticationAttributes; - } - - public QualityAuthenticationAssuranceLevel getQAALevel() { - return qaaLevel; - } - - public RequestedAttributes getRequestedAttributes() { - return requestedAttributes; - } - - public void setAuthenticationAttributes( - AuthenticationAttributes authenticationAttributes) { - this.authenticationAttributes = authenticationAttributes; - } - - public void setQAALevel(QualityAuthenticationAssuranceLevel authLevel) { - this.qaaLevel = authLevel; - } - - public void setRequestedAttributes(RequestedAttributes requestedAttributes) { - this.requestedAttributes = requestedAttributes; - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsMarshaller.java deleted file mode 100644 index 7aa86c2ed..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsMarshaller.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.saml2.common.impl.ExtensionsMarshaller; - -public class STORKExtensionsMarshaller extends ExtensionsMarshaller { - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsUnmarshaller.java deleted file mode 100644 index a701c9e6f..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKExtensionsUnmarshaller.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.saml2.common.impl.ExtensionsUnmarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.UnmarshallingException; - -import eu.stork.vidp.messages.saml.STORKExtensions; -import eu.stork.vidp.messages.stork.AuthenticationAttributes; -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; -import eu.stork.vidp.messages.stork.RequestedAttributes; - -public class STORKExtensionsUnmarshaller extends ExtensionsUnmarshaller { - - protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject) - throws UnmarshallingException { - STORKExtensions extensions = (STORKExtensions) parentXMLObject; - - if (childXMLObject instanceof QualityAuthenticationAssuranceLevel) { - QualityAuthenticationAssuranceLevel qaa = (QualityAuthenticationAssuranceLevel) childXMLObject; - extensions.setQAALevel(qaa); - } if (childXMLObject instanceof RequestedAttributes) { - RequestedAttributes requestedAttributes = (RequestedAttributes) childXMLObject; - extensions.setRequestedAttributes(requestedAttributes); - } if (childXMLObject instanceof AuthenticationAttributes) { - AuthenticationAttributes authenticationAttributes = (AuthenticationAttributes) childXMLObject; - extensions.setAuthenticationAttributes(authenticationAttributes); - } else { - super.processChildElement(parentXMLObject, childXMLObject); - } - -} - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeBuilder.java deleted file mode 100644 index 1e23a9f2b..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeBuilder.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.common.impl.AbstractSAMLObjectBuilder; -import org.opensaml.saml2.metadata.RequestedAttribute; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.saml.STORKRequestedAttribute; - -/** - * Builder for {@link org.opensaml.saml2.metadata.impl.RequestedAttributeImpl}. - */ -public class STORKRequestedAttributeBuilder extends AbstractSAMLObjectBuilder { - - /** Constructor */ - public STORKRequestedAttributeBuilder() { - - } - - /** {@inheritDoc} */ - public STORKRequestedAttribute buildObject() { - return buildObject(STORKConstants.STORK10_NS, STORKRequestedAttribute.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - - /** {@inheritDoc} */ - public STORKRequestedAttribute buildObject(String namespaceURI, String localName, String namespacePrefix) { - return new STORKRequestedAttributeImpl(namespaceURI, localName, namespacePrefix); - } -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeImpl.java deleted file mode 100644 index e3921919a..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - - -/** - * - */ - -package eu.stork.vidp.messages.saml.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.opensaml.saml2.metadata.impl.RequestedAttributeImpl; -import org.opensaml.xml.XMLObject; - -import eu.stork.vidp.messages.saml.STORKRequestedAttribute; - -/** - * Concrete implementation of {@link org.opensaml.saml2.metadata.RequestedAttribute} - */ -public class STORKRequestedAttributeImpl extends RequestedAttributeImpl implements STORKRequestedAttribute { - - /** - * Constructor - * - * @param namespaceURI - * @param elementLocalName - * @param namespacePrefix - */ - protected STORKRequestedAttributeImpl(String namespaceURI, String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - /** {@inheritDoc} */ - public List getOrderedChildren() { - ArrayList children = new ArrayList(); - - children.addAll(getAttributeValues()); - - return Collections.unmodifiableList(children); - } -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeUnmarshaller.java deleted file mode 100644 index 6b7771c72..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKRequestedAttributeUnmarshaller.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - - -/** - * - */ - -package eu.stork.vidp.messages.saml.impl; - -import javax.xml.namespace.QName; - -import org.opensaml.common.xml.SAMLConstants; -import org.opensaml.saml2.core.Attribute; -import org.opensaml.saml2.metadata.impl.RequestedAttributeUnmarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.UnmarshallingException; - -import eu.stork.vidp.messages.common.STORKConstants; - - -/** - * A thread-safe Unmarshaller for {@link org.opensaml.saml2.metadata.RequestedAttribute} objects. - */ -public class STORKRequestedAttributeUnmarshaller extends RequestedAttributeUnmarshaller { - - protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) - throws UnmarshallingException { - - Attribute attribute = (Attribute) parentSAMLObject; - - QName childQName = childSAMLObject.getElementQName(); - if (childQName.getLocalPart().equals("AttributeValue") - && childQName.getNamespaceURI().equals(STORKConstants.STORK10_NS)) { - attribute.getAttributeValues().add(childSAMLObject); - } else { - super.processChildElement(parentSAMLObject, childSAMLObject); - } -} - - -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseBuilder.java deleted file mode 100644 index 24cebaef7..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseBuilder.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.common.xml.SAMLConstants; -import org.opensaml.saml2.core.Response; -import org.opensaml.saml2.core.impl.ResponseBuilder; - -import eu.stork.mw.messages.saml.STORKResponse; - -public class STORKResponseBuilder extends ResponseBuilder { - - /** {@inheritDoc} */ - - - public STORKResponse buildObject() { - return buildObject(SAMLConstants.SAML20P_NS, Response.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX); - } - - /** {@inheritDoc} */ - public STORKResponse buildObject(String namespaceURI, String localName, String namespacePrefix) { - return new STORKResponseImpl(namespaceURI, localName, namespacePrefix); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseImpl.java deleted file mode 100644 index 08b5dc9bc..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.common.xml.SAMLConstants; -import org.opensaml.saml2.core.impl.ResponseImpl; - -import eu.stork.mw.messages.saml.STORKAuthnRequest; -import eu.stork.mw.messages.saml.STORKResponse; - -public class STORKResponseImpl extends ResponseImpl implements STORKResponse { - - private int qaaLevel; - - protected STORKResponseImpl(String namespaceURI, String elementLocalName, - String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - - - public STORKResponseImpl() { - super(SAMLConstants.SAML20P_NS, STORKResponse.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20P_PREFIX); - } - - - public int getQAALevel() { - return this.qaaLevel; - } - - public void setQAALevel(int authLevel) { - this.qaaLevel = authLevel; - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseMarshaller.java deleted file mode 100644 index 1a4654d01..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseMarshaller.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.saml2.core.impl.ResponseMarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.MarshallingException; -import org.w3c.dom.Element; - -import eu.stork.mw.messages.saml.STORKResponse; - -public class STORKResponseMarshaller extends ResponseMarshaller { - - protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException { - STORKResponse sr = (STORKResponse) samlObject; - -// if (sr.getQAA() != -1) { -// //domElement.setAttributeNS(null, StatusResponseType.VERSION_ATTRIB_NAME, sr.getVersion().toString()); -// } - } -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseUnmarshaller.java deleted file mode 100644 index c2a7bcef9..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/saml/impl/STORKResponseUnmarshaller.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.saml.impl; - -import org.opensaml.saml2.core.impl.ResponseUnmarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.UnmarshallingException; - -import eu.stork.mw.messages.saml.STORKResponse; -import eu.stork.vidp.messages.saml.STORKExtensions; - -public class STORKResponseUnmarshaller extends ResponseUnmarshaller { - - protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) - throws UnmarshallingException { - STORKResponse resp = (STORKResponse) parentSAMLObject; - - if (childSAMLObject instanceof STORKExtensions) { - STORKExtensions ext = (STORKExtensions) childSAMLObject; - - if (ext.getQAALevel() != null) - resp.setQAALevel(ext.getQAALevel().getValue()); - } else { - super.processChildElement(parentSAMLObject, childSAMLObject); - } - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/AuthenticationAttributes.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/AuthenticationAttributes.java deleted file mode 100644 index 73f9cd503..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/AuthenticationAttributes.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface AuthenticationAttributes extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "AuthenticationAttributes"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - /** Local name of the XSI type. */ - public static final String TYPE_LOCAL_NAME = "AuthenticationAttributesType"; - - /** QName of the XSI type. */ - public static final QName TYPE_NAME = new QName(STORKConstants.STORKP10_NS, TYPE_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setVIDPAuthenticationAttributes(VIDPAuthenticationAttributes authenticationAttributes); - - public VIDPAuthenticationAttributes getVIDPAuthenticationAttributes(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/CitizenCountryCode.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/CitizenCountryCode.java deleted file mode 100644 index 8c7847dd7..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/CitizenCountryCode.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface CitizenCountryCode extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "CitizenCountryCode"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setValue(String citizenCountryCode); - - public String getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDCrossBorderShare.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDCrossBorderShare.java deleted file mode 100644 index c0f7cb291..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDCrossBorderShare.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -/** - * @author bzwattendorfer - * - */ -public interface EIDCrossBorderShare extends ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "eIDCrossBorderShare"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setValue(boolean value); - - public boolean getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDCrossSectorShare.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDCrossSectorShare.java deleted file mode 100644 index a04376fb2..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDCrossSectorShare.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -/** - * @author bzwattendorfer - * - */ -public interface EIDCrossSectorShare extends ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "eIDCrossSectorShare"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setValue(boolean value); - - public boolean getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDSectorShare.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDSectorShare.java deleted file mode 100644 index 4fbd4a2d9..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/EIDSectorShare.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -/** - * @author bzwattendorfer - * - */ -public interface EIDSectorShare extends ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "eIDSectorShare"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setValue(boolean value); - - public boolean getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/QualityAuthenticationAssuranceLevel.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/QualityAuthenticationAssuranceLevel.java deleted file mode 100644 index 2869177b2..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/QualityAuthenticationAssuranceLevel.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface QualityAuthenticationAssuranceLevel extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "QualityAuthenticationAssuranceLevel"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORK10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - - public void setValue(int level); - - public int getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/RequestedAttributes.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/RequestedAttributes.java deleted file mode 100644 index 0dcb1964c..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/RequestedAttributes.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface RequestedAttributes extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "RequestedAttributes"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - /** Local name of the XSI type. */ - public static final String TYPE_LOCAL_NAME = "RequestedAttributesType"; - - /** QName of the XSI type. */ - public static final QName TYPE_NAME = new QName(STORKConstants.STORKP10_NS, TYPE_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setRequestedAttributes(List requestedAttributes); - - public List getRequestedAttributes(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPAuthRequest.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPAuthRequest.java deleted file mode 100644 index 8a5fd8644..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPAuthRequest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.ElementExtensibleXMLObject; -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -/** - * SAML 2.0 Extensions - */ -public interface SPAuthRequest extends ValidatingXMLObject, ElementExtensibleXMLObject { - - /** Local name, no namespace */ - public final static String LOCAL_NAME = "SPAuthRequest"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertEnc.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertEnc.java deleted file mode 100644 index fd0ff31ae..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertEnc.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SPCertEnc extends - SPCertType { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SPCertEnc"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertSig.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertSig.java deleted file mode 100644 index c54d23505..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertSig.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SPCertSig extends - SPCertType { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SPCertSig"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertType.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertType.java deleted file mode 100644 index e24db06a7..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPCertType.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.signature.KeyInfo; -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SPCertType extends - ValidatingXMLObject { - - /** Local name of the XSI type. */ - public static final String TYPE_LOCAL_NAME = "SPCertType"; - - /** QName of the XSI type. */ - public static final QName TYPE_NAME = new QName(STORKConstants.STORKP10_NS, TYPE_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setKeyInfo(KeyInfo keyInfo); - - public KeyInfo getKeyInfo(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPID.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPID.java deleted file mode 100644 index 6c8122b88..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPID.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SPID extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SPID"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setValue(String spID); - - public String getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPInformation.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPInformation.java deleted file mode 100644 index e0926cd65..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SPInformation.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SPInformation extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SPInformation"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - /** Local name of the XSI type. */ - public static final String TYPE_LOCAL_NAME = "SPInformationType"; - - /** QName of the XSI type. */ - public static final QName TYPE_NAME = new QName(STORKConstants.STORKP10_NS, TYPE_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setSPID(SPID spID); - - public SPID getSPID(); - - public void setSPCertSig(SPCertSig spCertSig); - - public SPCertSig getSPCertSig(); - - public void setSPCertEnc(SPCertEnc spCertEnc); - - public SPCertEnc getSPCertEnc(); - - public void setSPAuthRequest(SPAuthRequest spAuthRequest); - - public SPAuthRequest getSPAuthRequest(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpApplication.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpApplication.java deleted file mode 100644 index c68a29297..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpApplication.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SpApplication extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "spApplication"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORK10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - - public void setValue(String spApplication); - - public String getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpCountry.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpCountry.java deleted file mode 100644 index d7708cb62..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpCountry.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SpCountry extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "spCountry"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORK10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - - public void setValue(String spCountry); - - public String getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpInstitution.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpInstitution.java deleted file mode 100644 index dddd9e599..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpInstitution.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SpInstitution extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "spInstitution"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORK10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - - public void setValue(String spInstitution); - - public String getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpSector.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpSector.java deleted file mode 100644 index f29bf02c8..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/SpSector.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface SpSector extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "spSector"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORK10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - - public void setValue(String spSector); - - public String getValue(); - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/VIDPAuthenticationAttributes.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/VIDPAuthenticationAttributes.java deleted file mode 100644 index 89c4bec61..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/VIDPAuthenticationAttributes.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.validation.ValidatingXMLObject; - -import eu.stork.vidp.messages.common.STORKConstants; - -public interface VIDPAuthenticationAttributes extends - ValidatingXMLObject { - - /** Element local name. */ - public static final String DEFAULT_ELEMENT_LOCAL_NAME = "VIDPAuthenticationAttributes"; - - /** Default element name. */ - public static final QName DEFAULT_ELEMENT_NAME = new QName(STORKConstants.STORKP10_NS, DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - /** Local name of the XSI type. */ - public static final String TYPE_LOCAL_NAME = "VIDPAuthenticationAttributesType"; - - /** QName of the XSI type. */ - public static final QName TYPE_NAME = new QName(STORKConstants.STORKP10_NS, TYPE_LOCAL_NAME, - STORKConstants.STORKP10_PREFIX); - - public void setCitizenCountryCode(CitizenCountryCode citizenCountryCode); - - public CitizenCountryCode getCitizenCountryCode(); - - public void setSPInformation(SPInformation spInformation); - - public SPInformation getSPInformation(); - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesBuilder.java deleted file mode 100644 index 7fb418f74..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.AuthenticationAttributes; - -public class AuthenticationAttributesBuilder extends - AbstractXMLObjectBuilder { - - @Override - public AuthenticationAttributes buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new AuthenticationAttributesImpl(namespaceURI, localName, namespacePrefix); - } - - public AuthenticationAttributes buildObject() { - return buildObject(STORKConstants.STORK10_NS, AuthenticationAttributes.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesImpl.java deleted file mode 100644 index 68e751fdc..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.AuthenticationAttributes; -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -public class AuthenticationAttributesImpl extends - AbstractValidatingXMLObject implements - AuthenticationAttributes { - - private VIDPAuthenticationAttributes authenticationAttributes; - - - protected AuthenticationAttributesImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public VIDPAuthenticationAttributes getVIDPAuthenticationAttributes() { - return authenticationAttributes; - } - - public void setVIDPAuthenticationAttributes( - VIDPAuthenticationAttributes authenticationAttributes) { - this.authenticationAttributes = authenticationAttributes; - } - - - public List getOrderedChildren() { - ArrayList children = new ArrayList(); - - if (authenticationAttributes != null) { - children.add(authenticationAttributes); - } - - if (children.size() == 0) { - return null; - } - - return Collections.unmodifiableList(children); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesMarshaller.java deleted file mode 100644 index 05f1f9aec..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesMarshaller.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.io.BaseXMLObjectMarshaller; - -public class AuthenticationAttributesMarshaller extends - BaseXMLObjectMarshaller { - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesUnmarshaller.java deleted file mode 100644 index 564d62383..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/AuthenticationAttributesUnmarshaller.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; -import org.opensaml.xml.io.UnmarshallingException; - -import eu.stork.vidp.messages.stork.AuthenticationAttributes; -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -public class AuthenticationAttributesUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processChildElement(XMLObject parentXMLObject, - XMLObject childXMLObject) throws UnmarshallingException { - AuthenticationAttributes attributes = (AuthenticationAttributes) parentXMLObject; - - if (childXMLObject instanceof VIDPAuthenticationAttributes) { - attributes.setVIDPAuthenticationAttributes((VIDPAuthenticationAttributes) childXMLObject); - } else { - super.processChildElement(parentXMLObject, childXMLObject); - } - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeBuilder.java deleted file mode 100644 index de380d780..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.CitizenCountryCode; - -public class CitizenCountryCodeBuilder extends - AbstractXMLObjectBuilder { - - @Override - public CitizenCountryCode buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new CitizenCountryCodeImpl(namespaceURI, localName, namespacePrefix); - } - - public CitizenCountryCode buildObject() { - return buildObject(STORKConstants.STORK10_NS, CitizenCountryCode.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeImpl.java deleted file mode 100644 index 3de591116..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.CitizenCountryCode; - -public class CitizenCountryCodeImpl extends - AbstractValidatingXMLObject implements - CitizenCountryCode { - - private String citizenCountryCode; - - protected CitizenCountryCodeImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public String getValue() { - return citizenCountryCode; - } - - public void setValue(String citizenCountryCode) { - this.citizenCountryCode = citizenCountryCode; - } - - public List getOrderedChildren() { - return Collections.emptyList(); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeMarshaller.java deleted file mode 100644 index 8d47d6117..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.CitizenCountryCode; - -public class CitizenCountryCodeMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException { - CitizenCountryCode ccc = (CitizenCountryCode) xmlObject; - XMLHelper.appendTextContent(domElement, ccc.getValue()); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeUnmarshaller.java deleted file mode 100644 index 69bd4cdb1..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/CitizenCountryCodeUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.CitizenCountryCode; - -public class CitizenCountryCodeUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - CitizenCountryCode ccc = (CitizenCountryCode) xmlObject; - ccc.setValue(elementContent); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareBuilder.java deleted file mode 100644 index d2b1bba08..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.EIDCrossBorderShare; - -public class EIDCrossBorderShareBuilder extends - AbstractXMLObjectBuilder { - - @Override - public EIDCrossBorderShare buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new EIDCrossBorderShareImpl(namespaceURI, localName, namespacePrefix); - } - - public EIDCrossBorderShare buildObject() { - return buildObject(STORKConstants.STORKP10_NS, EIDCrossBorderShare.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORKP10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareImpl.java deleted file mode 100644 index e5182aff1..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.EIDCrossBorderShare; - -/** - * @author bzwattendorfer - * - */ -public class EIDCrossBorderShareImpl extends AbstractValidatingXMLObject implements - EIDCrossBorderShare { - - private boolean value; - - /** - * @param namespaceURI - * @param elementLocalName - * @param namespacePrefix - */ - public EIDCrossBorderShareImpl(String namespaceURI, String elementLocalName, - String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - /* (non-Javadoc) - * @see eu.stork.mw.common.messages.stork.EIDSectorShare#getValue() - */ - public boolean getValue() { - return this.value; - } - - /* (non-Javadoc) - * @see eu.stork.mw.common.messages.stork.EIDSectorShare#setValue(boolean) - */ - public void setValue(boolean value) { - this.value = value; - - } - - /* (non-Javadoc) - * @see org.opensaml.xml.XMLObject#getOrderedChildren() - */ - public List getOrderedChildren() { - return Collections.emptyList(); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareMarshaller.java deleted file mode 100644 index 1b98e8a2b..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.EIDCrossBorderShare; - -public class EIDCrossBorderShareMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException { - EIDCrossBorderShare cbs = (EIDCrossBorderShare) samlObject; - XMLHelper.appendTextContent(domElement, String.valueOf(cbs.getValue())); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareUnmarshaller.java deleted file mode 100644 index bb7b9d762..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossBorderShareUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.EIDCrossBorderShare; - -public class EIDCrossBorderShareUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - EIDCrossBorderShare cbs = (EIDCrossBorderShare) xmlObject; - cbs.setValue(Boolean.parseBoolean(elementContent)); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareBuilder.java deleted file mode 100644 index c02b11a7f..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.EIDCrossSectorShare; - -public class EIDCrossSectorShareBuilder extends - AbstractXMLObjectBuilder { - - @Override - public EIDCrossSectorShare buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new EIDCrossSectorShareImpl(namespaceURI, localName, namespacePrefix); - } - - public EIDCrossSectorShare buildObject() { - return buildObject(STORKConstants.STORKP10_NS, EIDCrossSectorShare.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORKP10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareImpl.java deleted file mode 100644 index b58ee4c4b..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.EIDCrossSectorShare; - -/** - * @author bzwattendorfer - * - */ -public class EIDCrossSectorShareImpl extends AbstractValidatingXMLObject implements - EIDCrossSectorShare { - - private boolean value; - - /** - * @param namespaceURI - * @param elementLocalName - * @param namespacePrefix - */ - public EIDCrossSectorShareImpl(String namespaceURI, String elementLocalName, - String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - /* (non-Javadoc) - * @see eu.stork.mw.common.messages.stork.EIDSectorShare#getValue() - */ - public boolean getValue() { - return this.value; - } - - /* (non-Javadoc) - * @see eu.stork.mw.common.messages.stork.EIDSectorShare#setValue(boolean) - */ - public void setValue(boolean value) { - this.value = value; - - } - - /* (non-Javadoc) - * @see org.opensaml.xml.XMLObject#getOrderedChildren() - */ - public List getOrderedChildren() { - return Collections.emptyList(); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareMarshaller.java deleted file mode 100644 index bcffdad4a..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.EIDCrossSectorShare; - -public class EIDCrossSectorShareMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException { - EIDCrossSectorShare css = (EIDCrossSectorShare) samlObject; - XMLHelper.appendTextContent(domElement, String.valueOf(css.getValue())); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareUnmarshaller.java deleted file mode 100644 index a249c4628..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDCrossSectorShareUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.EIDCrossSectorShare; - -public class EIDCrossSectorShareUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - EIDCrossSectorShare css = (EIDCrossSectorShare) xmlObject; - css.setValue(Boolean.parseBoolean(elementContent)); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareBuilder.java deleted file mode 100644 index 79e0d1122..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.EIDSectorShare; - -public class EIDSectorShareBuilder extends - AbstractXMLObjectBuilder { - - @Override - public EIDSectorShare buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new EIDSectorShareImpl(namespaceURI, localName, namespacePrefix); - } - - public EIDSectorShare buildObject() { - return buildObject(STORKConstants.STORKP10_NS, EIDSectorShare.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORKP10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareImpl.java deleted file mode 100644 index ae65ad36c..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.EIDSectorShare; - -/** - * @author bzwattendorfer - * - */ -public class EIDSectorShareImpl extends AbstractValidatingXMLObject implements - EIDSectorShare { - - private boolean value; - - /** - * @param namespaceURI - * @param elementLocalName - * @param namespacePrefix - */ - public EIDSectorShareImpl(String namespaceURI, String elementLocalName, - String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - /* (non-Javadoc) - * @see eu.stork.mw.common.messages.stork.EIDSectorShare#getValue() - */ - public boolean getValue() { - return this.value; - } - - /* (non-Javadoc) - * @see eu.stork.mw.common.messages.stork.EIDSectorShare#setValue(boolean) - */ - public void setValue(boolean value) { - this.value = value; - - } - - /* (non-Javadoc) - * @see org.opensaml.xml.XMLObject#getOrderedChildren() - */ - public List getOrderedChildren() { - return Collections.emptyList(); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareMarshaller.java deleted file mode 100644 index ed18cfbd4..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.EIDSectorShare; - -public class EIDSectorShareMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException { - EIDSectorShare ss = (EIDSectorShare) samlObject; - XMLHelper.appendTextContent(domElement, String.valueOf(ss.getValue())); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareUnmarshaller.java deleted file mode 100644 index 6631e1ac2..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/EIDSectorShareUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.EIDSectorShare; - -public class EIDSectorShareUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - EIDSectorShare ss = (EIDSectorShare) xmlObject; - ss.setValue(Boolean.parseBoolean(elementContent)); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelBuilder.java deleted file mode 100644 index d536372e8..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; - -public class QualityAuthenticationAssuranceLevelBuilder extends - AbstractXMLObjectBuilder { - - @Override - public QualityAuthenticationAssuranceLevel buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new QualityAuthenticationAssuranceLevelImpl(namespaceURI, localName, namespacePrefix); - } - - public QualityAuthenticationAssuranceLevel buildObject() { - return buildObject(STORKConstants.STORKP10_NS, QualityAuthenticationAssuranceLevel.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORKP10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelImpl.java deleted file mode 100644 index 69548c149..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; - -public class QualityAuthenticationAssuranceLevelImpl extends - AbstractValidatingXMLObject implements - QualityAuthenticationAssuranceLevel { - - private int qaaLevel; - - protected QualityAuthenticationAssuranceLevelImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public int getValue() { - return this.qaaLevel; - } - - public void setValue(int level) { - this.qaaLevel = level; - - } - - public List getOrderedChildren() { - return Collections.emptyList(); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelMarshaller.java deleted file mode 100644 index 7f0d28895..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; - -public class QualityAuthenticationAssuranceLevelMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException { - QualityAuthenticationAssuranceLevel qaa = (QualityAuthenticationAssuranceLevel) samlObject; - XMLHelper.appendTextContent(domElement, String.valueOf(qaa.getValue())); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelUnmarshaller.java deleted file mode 100644 index f024261f8..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/QualityAuthenticationAssuranceLevelUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; - -public class QualityAuthenticationAssuranceLevelUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - QualityAuthenticationAssuranceLevel qaa = (QualityAuthenticationAssuranceLevel) xmlObject; - qaa.setValue(Integer.parseInt(elementContent)); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesBuilder.java deleted file mode 100644 index d1e80abbb..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesBuilder.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - - -/** - * - */ - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.RequestedAttributes; - -/** - * Builder for {@link org.opensaml.saml2.core.impl.AudienceRestrictionImpl} objects. - */ -public class RequestedAttributesBuilder extends AbstractXMLObjectBuilder { - - /** Constructor. */ - public RequestedAttributesBuilder() { - - } - - /** {@inheritDoc} */ - public RequestedAttributes buildObject() { - return buildObject(STORKConstants.STORK10_NS, RequestedAttributes.DEFAULT_ELEMENT_LOCAL_NAME, - STORKConstants.STORK10_PREFIX); - } - - /** {@inheritDoc} */ - public RequestedAttributes buildObject(String namespaceURI, String localName, String namespacePrefix) { - return new RequestedAttributesImpl(namespaceURI, localName, namespacePrefix); - } -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesImpl.java deleted file mode 100644 index cd2b4a490..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - - -/** - * - */ - -package eu.stork.vidp.messages.stork.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.util.XMLObjectChildrenList; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.RequestedAttributes; - -/** - * Concrete implementation of {@link org.opensaml.saml2.core.AudienceRestriction}. - */ -public class RequestedAttributesImpl extends AbstractValidatingXMLObject implements RequestedAttributes { - - /** List of the audiences. */ - private XMLObjectChildrenList requestedAttributes; - - /** - * Constructor. - * - * @param namespaceURI the namespace the element is in - * @param elementLocalName the local name of the XML element this Object represents - * @param namespacePrefix the prefix for the given namespace - */ - protected RequestedAttributesImpl(String namespaceURI, String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - requestedAttributes = new XMLObjectChildrenList(this); - } - - /** {@inheritDoc} */ - public List getRequestedAttributes() { - return requestedAttributes; - } - - - /** {@inheritDoc} */ - public List getOrderedChildren() { - ArrayList children = new ArrayList(); - - children.addAll(requestedAttributes); - - return Collections.unmodifiableList(children); - } - - public void setRequestedAttributes( - List requestedAttributes) { - this.requestedAttributes = (XMLObjectChildrenList) requestedAttributes; - - } - - - - -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesMarshaller.java deleted file mode 100644 index 8716c45a5..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesMarshaller.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - - -/** - * - */ - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.io.BaseXMLObjectMarshaller; - -/** - * A thread safe Marshaller for {@link org.opensaml.saml2.core.AudienceRestriction} objects. - */ -public class RequestedAttributesMarshaller extends BaseXMLObjectMarshaller { - -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesUnmarshaller.java deleted file mode 100644 index 94e603bd9..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/RequestedAttributesUnmarshaller.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - - -/** - * - */ - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; -import org.opensaml.xml.io.UnmarshallingException; - -import eu.stork.vidp.messages.stork.RequestedAttributes; - -/** - * A thread-safe Unmarshaller for {@link org.opensaml.saml2.core.AudienceRestriction} objects. - */ -public class RequestedAttributesUnmarshaller extends BaseXMLObjectUnmarshaller { - - /** {@inheritDoc} */ - protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException { - RequestedAttributes requestedAttributes = (RequestedAttributes) parentObject; - - if (childObject instanceof RequestedAttribute) { - requestedAttributes.getRequestedAttributes().add((RequestedAttribute) childObject); - } else { - super.processChildElement(parentObject, childObject); - } - } -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestBuilder.java deleted file mode 100644 index 1febbf399..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestBuilder.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.SPAuthRequest; - -/** - * Builder of {@link org.opensaml.saml2.common.impl.ExtensionsImpl} objects. - */ -public class SPAuthRequestBuilder extends AbstractXMLObjectBuilder { - - /** - * {@inheritDoc} - */ - public SPAuthRequest buildObject() { - return buildObject(STORKConstants.STORK10_NS, SPAuthRequest.LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - - /** - * {@inheritDoc} - */ - public SPAuthRequest buildObject(String namespaceURI, String localName, String namespacePrefix) { - return new SPAuthRequestImpl(namespaceURI, localName, namespacePrefix); - } -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestImpl.java deleted file mode 100644 index 9ea20b9cc..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.util.IndexedXMLObjectChildrenList; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.SPAuthRequest; - -/** - * - */ -public class SPAuthRequestImpl extends AbstractValidatingXMLObject implements SPAuthRequest { - - /** "any" children */ - private final IndexedXMLObjectChildrenList unknownChildren; - - /** - * Constructor - * - * @param namespaceURI - * @param elementLocalName - * @param namespacePrefix - */ - protected SPAuthRequestImpl(String namespaceURI, String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - unknownChildren = new IndexedXMLObjectChildrenList(this); - } - - /** - * {@inheritDoc} - */ - public List getUnknownXMLObjects() { - return unknownChildren; - } - - /** {@inheritDoc} */ - @SuppressWarnings("unchecked") - public List getUnknownXMLObjects(QName typeOrName) { - return (List) unknownChildren.subList(typeOrName); - } - - /** {@inheritDoc} */ - public List getOrderedChildren() { - return Collections.unmodifiableList(unknownChildren); - } -} \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestMarshaller.java deleted file mode 100644 index feb730935..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestMarshaller.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.AbstractXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.w3c.dom.Element; - -/** - * A thread-safe Marshaller for {@link org.opensaml.saml2.common.Extensions} objects. - */ -public class SPAuthRequestMarshaller extends AbstractXMLObjectMarshaller { - - /** - * Constructor - */ - public SPAuthRequestMarshaller() { - super(); - } - - /** - * {@inheritDoc} - */ - protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException { - // no attributes - } - - /** - * {@inheritDoc} - */ - protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException { - // no content - } -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestUnmarshaller.java deleted file mode 100644 index 7d5be220d..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPAuthRequestUnmarshaller.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.AbstractXMLObjectUnmarshaller; -import org.opensaml.xml.io.UnmarshallingException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Attr; - -import eu.stork.vidp.messages.stork.SPAuthRequest; - -public class SPAuthRequestUnmarshaller extends AbstractXMLObjectUnmarshaller { - - /** Logger. */ - private final Logger log = LoggerFactory.getLogger(AbstractSAMLObjectUnmarshaller.class); - - /** Constructor. */ - public SPAuthRequestUnmarshaller() { - super(); - } - - /** - * {@inheritDoc} - */ - protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject) - throws UnmarshallingException { - SPAuthRequest spAuthRequest = (SPAuthRequest) parentXMLObject; - - spAuthRequest.getUnknownXMLObjects().add(childXMLObject); - } - - /** - * {@inheritDoc} - */ - protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { - log.debug("Ignorning unknown attribute {}", attribute.getLocalName()); - } - - /** - * {@inheritDoc} - */ - protected void processElementContent(XMLObject xmlObject, String elementContent) { - log.debug("Ignoring element content {}", elementContent); - } -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncBuilder.java deleted file mode 100644 index eb13ddf73..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.SPCertEnc; - -public class SPCertEncBuilder extends - AbstractXMLObjectBuilder { - - @Override - public SPCertEnc buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new SPCertEncImpl(namespaceURI, localName, namespacePrefix); - } - - public SPCertEnc buildObject() { - return buildObject(STORKConstants.STORK10_NS, SPCertEnc.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncImpl.java deleted file mode 100644 index 2ee08e1ec..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import eu.stork.vidp.messages.stork.SPCertEnc; - -public class SPCertEncImpl extends - SPCertTypeImpl implements - SPCertEnc { - - protected SPCertEncImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncMarshaller.java deleted file mode 100644 index 091676959..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncMarshaller.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - - -public class SPCertEncMarshaller extends - SPCertTypeMarshaller { - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncUnmarshaller.java deleted file mode 100644 index 3b6339609..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertEncUnmarshaller.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - - -public class SPCertEncUnmarshaller extends - SPCertTypeUnmarshaller { - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigBuilder.java deleted file mode 100644 index 5e75a0e2c..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.SPCertSig; - -public class SPCertSigBuilder extends - AbstractXMLObjectBuilder { - - @Override - public SPCertSig buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new SPCertSigImpl(namespaceURI, localName, namespacePrefix); - } - - public SPCertSig buildObject() { - return buildObject(STORKConstants.STORK10_NS, SPCertSig.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigImpl.java deleted file mode 100644 index f98e3ede3..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import eu.stork.vidp.messages.stork.SPCertSig; - -public class SPCertSigImpl extends - SPCertTypeImpl implements - SPCertSig { - - protected SPCertSigImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigMarshaller.java deleted file mode 100644 index e9f3d14da..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigMarshaller.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - - -public class SPCertSigMarshaller extends - SPCertTypeMarshaller { - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigUnmarshaller.java deleted file mode 100644 index d706223cb..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertSigUnmarshaller.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - - -public class SPCertSigUnmarshaller extends - SPCertTypeUnmarshaller { - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeImpl.java deleted file mode 100644 index a9a30dada..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.signature.KeyInfo; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.SPCertType; - -public class SPCertTypeImpl extends - AbstractValidatingXMLObject implements - SPCertType { - - private KeyInfo keyInfo; - - protected SPCertTypeImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public KeyInfo getKeyInfo() { - return keyInfo; - } - - public void setKeyInfo(KeyInfo keyInfo) { - this.keyInfo = keyInfo; - } - - public List getOrderedChildren() { - ArrayList children = new ArrayList(); - - if (keyInfo != null) { - children.add(keyInfo); - } - - if (children.size() == 0) { - return null; - } - - return Collections.unmodifiableList(children); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeMarshaller.java deleted file mode 100644 index 0443a721a..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeMarshaller.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.io.BaseXMLObjectMarshaller; - -public class SPCertTypeMarshaller extends - BaseXMLObjectMarshaller { - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeUnmarshaller.java deleted file mode 100644 index e23ff6b54..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPCertTypeUnmarshaller.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; -import org.opensaml.xml.io.UnmarshallingException; -import org.opensaml.xml.signature.KeyInfo; - -import eu.stork.vidp.messages.stork.SPCertType; - -public class SPCertTypeUnmarshaller extends - BaseXMLObjectUnmarshaller { - - - @Override - protected void processChildElement(XMLObject parentXMLObject, - XMLObject childXMLObject) throws UnmarshallingException { - SPCertType spCertType = (SPCertType) parentXMLObject; - - if (childXMLObject instanceof KeyInfo) { - spCertType.setKeyInfo((KeyInfo) childXMLObject); - } else { - super.processChildElement(parentXMLObject, childXMLObject); - } - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDBuilder.java deleted file mode 100644 index f892c88c3..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.SPID; - -public class SPIDBuilder extends - AbstractXMLObjectBuilder { - - @Override - public SPID buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new SPIDImpl(namespaceURI, localName, namespacePrefix); - } - - public SPID buildObject() { - return buildObject(STORKConstants.STORK10_NS, SPID.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDImpl.java deleted file mode 100644 index 34bde4caa..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.SPID; - -public class SPIDImpl extends - AbstractValidatingXMLObject implements - SPID { - - private String spID; - - protected SPIDImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public String getValue() { - return spID; - } - - public void setValue(String spID) { - this.spID = spID; - } - - public List getOrderedChildren() { - return Collections.emptyList(); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDMarshaller.java deleted file mode 100644 index 8455d5033..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.SPID; - -public class SPIDMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException { - SPID spID = (SPID) xmlObject; - XMLHelper.appendTextContent(domElement, spID.getValue()); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDUnmarshaller.java deleted file mode 100644 index f2eb1eb00..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPIDUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.SPID; - -public class SPIDUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - SPID spID = (SPID) xmlObject; - spID.setValue(elementContent); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationBuilder.java deleted file mode 100644 index 1bc9c6ae8..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.SPInformation; - -public class SPInformationBuilder extends - AbstractXMLObjectBuilder { - - @Override - public SPInformation buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new SPInformationImpl(namespaceURI, localName, namespacePrefix); - } - - public SPInformation buildObject() { - return buildObject(STORKConstants.STORK10_NS, SPInformation.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationImpl.java deleted file mode 100644 index e42c1cff5..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.SPAuthRequest; -import eu.stork.vidp.messages.stork.SPCertEnc; -import eu.stork.vidp.messages.stork.SPCertSig; -import eu.stork.vidp.messages.stork.SPID; -import eu.stork.vidp.messages.stork.SPInformation; - -public class SPInformationImpl extends - AbstractValidatingXMLObject implements - SPInformation { - - private SPID spID; - - private SPCertSig spCertSig; - - private SPCertEnc spCertEnc; - - private SPAuthRequest spAuthRequest; - - protected SPInformationImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public SPAuthRequest getSPAuthRequest() { - return spAuthRequest; - } - - public SPCertEnc getSPCertEnc() { - return spCertEnc; - } - - public SPCertSig getSPCertSig() { - return spCertSig; - } - - public SPID getSPID() { - return spID; - } - - public void setSPAuthRequest(SPAuthRequest spAuthRequest) { - this.spAuthRequest = spAuthRequest; - } - - public void setSPCertEnc(SPCertEnc spCertEnc) { - this.spCertEnc = spCertEnc; - } - - public void setSPCertSig(SPCertSig spCertSig) { - this.spCertSig = spCertSig; - } - - public void setSPID(SPID spID) { - this.spID = spID; - } - - public List getOrderedChildren() { - ArrayList children = new ArrayList(); - - if (spID != null) { - children.add(spID); - } - - if (spCertSig != null) { - children.add(spCertSig); - } - - if (spCertEnc != null) { - children.add(spCertEnc); - } - - if (spAuthRequest != null) { - children.add(spAuthRequest); - } - - if (children.size() == 0) { - return null; - } - - return Collections.unmodifiableList(children); - } - - - - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationMarshaller.java deleted file mode 100644 index aea91af92..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationMarshaller.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.io.BaseXMLObjectMarshaller; - -public class SPInformationMarshaller extends - BaseXMLObjectMarshaller { - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationUnmarshaller.java deleted file mode 100644 index e7f9bd98e..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SPInformationUnmarshaller.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; -import org.opensaml.xml.io.UnmarshallingException; - -import eu.stork.vidp.messages.stork.SPAuthRequest; -import eu.stork.vidp.messages.stork.SPCertEnc; -import eu.stork.vidp.messages.stork.SPCertSig; -import eu.stork.vidp.messages.stork.SPID; -import eu.stork.vidp.messages.stork.SPInformation; - -public class SPInformationUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processChildElement(XMLObject parentXMLObject, - XMLObject childXMLObject) throws UnmarshallingException { - SPInformation spInformation = (SPInformation) parentXMLObject; - - if (childXMLObject instanceof SPID) { - spInformation.setSPID((SPID) childXMLObject); - } else if (childXMLObject instanceof SPCertSig) { - spInformation.setSPCertSig((SPCertSig) childXMLObject); - } if (childXMLObject instanceof SPCertEnc) { - spInformation.setSPCertEnc((SPCertEnc) childXMLObject); - } if (childXMLObject instanceof SPAuthRequest) { - spInformation.setSPAuthRequest((SPAuthRequest) childXMLObject); - } else { - super.processChildElement(parentXMLObject, childXMLObject); - } - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationBuilder.java deleted file mode 100644 index 596d77908..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.SpApplication; - -public class SpApplicationBuilder extends - AbstractXMLObjectBuilder { - - @Override - public SpApplication buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new SpApplicationImpl(namespaceURI, localName, namespacePrefix); - } - - public SpApplication buildObject() { - return buildObject(STORKConstants.STORK10_NS, SpApplication.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationImpl.java deleted file mode 100644 index d9c3b3ad2..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.SpApplication; - -public class SpApplicationImpl extends - AbstractValidatingXMLObject implements - SpApplication { - - private String spApplication; - - protected SpApplicationImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public String getValue() { - return spApplication; - } - - public void setValue(String spApplication) { - this.spApplication = spApplication; - } - - public List getOrderedChildren() { - return Collections.emptyList(); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationMarshaller.java deleted file mode 100644 index 1b484e338..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.SpApplication; - -public class SpApplicationMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException { - SpApplication spApplication = (SpApplication) xmlObject; - XMLHelper.appendTextContent(domElement, spApplication.getValue()); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationUnmarshaller.java deleted file mode 100644 index 70aef824a..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpApplicationUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.SpApplication; - -public class SpApplicationUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - SpApplication spSector = (SpApplication) xmlObject; - spSector.setValue(elementContent); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryBuilder.java deleted file mode 100644 index 29c765128..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.SpCountry; - -public class SpCountryBuilder extends - AbstractXMLObjectBuilder { - - @Override - public SpCountry buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new SpCountryImpl(namespaceURI, localName, namespacePrefix); - } - - public SpCountry buildObject() { - return buildObject(STORKConstants.STORK10_NS, SpCountry.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryImpl.java deleted file mode 100644 index 66e2e81a6..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.SpCountry; - -public class SpCountryImpl extends - AbstractValidatingXMLObject implements - SpCountry { - - private String spCountry; - - protected SpCountryImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public String getValue() { - return spCountry; - } - - public void setValue(String spCountry) { - this.spCountry = spCountry; - } - - public List getOrderedChildren() { - return Collections.emptyList(); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryMarshaller.java deleted file mode 100644 index 60a1f7838..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.SpCountry; - -public class SpCountryMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException { - SpCountry spCountry = (SpCountry) xmlObject; - XMLHelper.appendTextContent(domElement, spCountry.getValue()); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryUnmarshaller.java deleted file mode 100644 index 66558248b..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpCountryUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.SpCountry; - -public class SpCountryUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - SpCountry spCountry = (SpCountry) xmlObject; - spCountry.setValue(elementContent); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionBuilder.java deleted file mode 100644 index 4ddc48d53..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.SpInstitution; - -public class SpInstitutionBuilder extends - AbstractXMLObjectBuilder { - - @Override - public SpInstitution buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new SpInstitutionImpl(namespaceURI, localName, namespacePrefix); - } - - public SpInstitution buildObject() { - return buildObject(STORKConstants.STORK10_NS, SpInstitution.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionImpl.java deleted file mode 100644 index 8d9753328..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.SpInstitution; - -public class SpInstitutionImpl extends - AbstractValidatingXMLObject implements - SpInstitution { - - private String spInstitution; - - protected SpInstitutionImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public String getValue() { - return spInstitution; - } - - public void setValue(String spInstitution) { - this.spInstitution = spInstitution; - } - - public List getOrderedChildren() { - return Collections.emptyList(); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionMarshaller.java deleted file mode 100644 index ec150523d..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.SpInstitution; - -public class SpInstitutionMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException { - SpInstitution spInstitution = (SpInstitution) xmlObject; - XMLHelper.appendTextContent(domElement, spInstitution.getValue()); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionUnmarshaller.java deleted file mode 100644 index 34fa89281..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpInstitutionUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.SpInstitution; - -public class SpInstitutionUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - SpInstitution spInstitution = (SpInstitution) xmlObject; - spInstitution.setValue(elementContent); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorBuilder.java deleted file mode 100644 index 08daa3c7b..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorBuilder.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.CitizenCountryCode; -import eu.stork.vidp.messages.stork.SpSector; - -public class SpSectorBuilder extends - AbstractXMLObjectBuilder { - - @Override - public SpSector buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new SpSectorImpl(namespaceURI, localName, namespacePrefix); - } - - public SpSector buildObject() { - return buildObject(STORKConstants.STORK10_NS, SpSector.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorImpl.java deleted file mode 100644 index f52d2c83d..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.SpSector; - -public class SpSectorImpl extends - AbstractValidatingXMLObject implements - SpSector { - - private String spSector; - - protected SpSectorImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public String getValue() { - return spSector; - } - - public void setValue(String spSector) { - this.spSector = spSector; - } - - public List getOrderedChildren() { - return Collections.emptyList(); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorMarshaller.java deleted file mode 100644 index 78772c956..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorMarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectMarshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.util.XMLHelper; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.stork.SpSector; - -public class SpSectorMarshaller extends - BaseXMLObjectMarshaller { - - /** {@inheritDoc} */ - protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException { - SpSector spSector = (SpSector) xmlObject; - XMLHelper.appendTextContent(domElement, spSector.getValue()); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorUnmarshaller.java deleted file mode 100644 index ea65413a2..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/SpSectorUnmarshaller.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; - -import eu.stork.vidp.messages.stork.SpSector; - -public class SpSectorUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processElementContent(XMLObject xmlObject, - String elementContent) { - SpSector spSector = (SpSector) xmlObject; - spSector.setValue(elementContent); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesBuilder.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesBuilder.java deleted file mode 100644 index a7827f652..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.AbstractXMLObjectBuilder; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -public class VIDPAuthenticationAttributesBuilder extends - AbstractXMLObjectBuilder { - - @Override - public VIDPAuthenticationAttributes buildObject(String namespaceURI, String localName, - String namespacePrefix) { - return new VIDPAuthenticationAttributesImpl(namespaceURI, localName, namespacePrefix); - } - - public VIDPAuthenticationAttributes buildObject() { - return buildObject(STORKConstants.STORK10_NS, VIDPAuthenticationAttributes.DEFAULT_ELEMENT_LOCAL_NAME, STORKConstants.STORK10_PREFIX); - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesImpl.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesImpl.java deleted file mode 100644 index 3c8d960db..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.AbstractValidatingXMLObject; - -import eu.stork.vidp.messages.stork.CitizenCountryCode; -import eu.stork.vidp.messages.stork.SPInformation; -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -public class VIDPAuthenticationAttributesImpl extends - AbstractValidatingXMLObject implements - VIDPAuthenticationAttributes { - - private CitizenCountryCode citizenCountryCode; - - private SPInformation spInformation; - - protected VIDPAuthenticationAttributesImpl(String namespaceURI, - String elementLocalName, String namespacePrefix) { - super(namespaceURI, elementLocalName, namespacePrefix); - } - - public CitizenCountryCode getCitizenCountryCode() { - return citizenCountryCode; - } - - - public SPInformation getSPInformation() { - return spInformation; - } - - public void setCitizenCountryCode(CitizenCountryCode citizenCountryCode) { - this.citizenCountryCode = citizenCountryCode; - } - - - public void setSPInformation(SPInformation spInformation) { - this.spInformation = spInformation; - } - - public List getOrderedChildren() { - ArrayList children = new ArrayList(); - - if (citizenCountryCode != null) { - children.add(citizenCountryCode); - } - - - if (spInformation != null) { - children.add(spInformation); - } - - if (children.size() == 0) { - return null; - } - - return Collections.unmodifiableList(children); - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesMarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesMarshaller.java deleted file mode 100644 index f21b492a9..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesMarshaller.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.io.BaseXMLObjectMarshaller; - -public class VIDPAuthenticationAttributesMarshaller extends - BaseXMLObjectMarshaller { - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesUnmarshaller.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesUnmarshaller.java deleted file mode 100644 index 3b7a1b20e..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/stork/impl/VIDPAuthenticationAttributesUnmarshaller.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.stork.impl; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.BaseXMLObjectUnmarshaller; -import org.opensaml.xml.io.UnmarshallingException; - -import eu.stork.vidp.messages.stork.CitizenCountryCode; -import eu.stork.vidp.messages.stork.SPInformation; -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -public class VIDPAuthenticationAttributesUnmarshaller extends - BaseXMLObjectUnmarshaller { - - @Override - protected void processChildElement(XMLObject parentXMLObject, - XMLObject childXMLObject) throws UnmarshallingException { - VIDPAuthenticationAttributes attributes = (VIDPAuthenticationAttributes) parentXMLObject; - - if (childXMLObject instanceof CitizenCountryCode) { - attributes.setCitizenCountryCode((CitizenCountryCode) childXMLObject); - } else if (childXMLObject instanceof SPInformation) { - attributes.setSPInformation((SPInformation) childXMLObject); - } else { - super.processChildElement(parentXMLObject, childXMLObject); - } - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/util/SAMLUtil.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/util/SAMLUtil.java deleted file mode 100644 index faff5e7bd..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/util/SAMLUtil.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.util; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.opensaml.Configuration; -import org.opensaml.common.SignableSAMLObject; -import org.opensaml.saml2.core.Assertion; -import org.opensaml.saml2.core.Attribute; -import org.opensaml.saml2.core.AttributeStatement; -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.security.SAMLSignatureProfileValidator; -import org.opensaml.ws.message.encoder.MessageEncodingException; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.io.Marshaller; -import org.opensaml.xml.io.MarshallingException; -import org.opensaml.xml.io.Unmarshaller; -import org.opensaml.xml.io.UnmarshallingException; -import org.opensaml.xml.schema.XSAny; -import org.opensaml.xml.schema.XSString; -import org.opensaml.xml.security.SecurityException; -import org.opensaml.xml.security.SecurityHelper; -import org.opensaml.xml.security.credential.Credential; -import org.opensaml.xml.signature.Signature; -import org.opensaml.xml.signature.SignatureConstants; -import org.opensaml.xml.signature.SignatureException; -import org.opensaml.xml.signature.Signer; -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.ValidatorSuite; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.w3c.dom.Element; - -import eu.stork.vidp.messages.builder.STORKMessagesBuilder; -import eu.stork.vidp.messages.exception.SAMLException; -import eu.stork.vidp.messages.exception.SAMLValidationException; -import eu.stork.vidp.messages.saml.STORKAttribute; - -/** - * - * Helper class for SAML message processing - * @author bzwattendorfer - * - */ -public class SAMLUtil { - - private final static Logger log = LoggerFactory.getLogger(SAMLUtil.class); - - /** - * Signs a SAML object - * @param samlObject SAML object to sign - * @param signingCredential Credentials to be used for signing - * @throws SAMLException - */ - public static void signSAMLObject(SignableSAMLObject samlObject, Credential signingCredential) throws SAMLException { - - log.trace("Signing " + samlObject.getElementQName()); - - Signature signature = STORKMessagesBuilder.buildXMLObject(Signature.DEFAULT_ELEMENT_NAME); - - signature.setSigningCredential(signingCredential); - - //TODO: Make signing algorithm configurable - signature.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1); - signature.setCanonicalizationAlgorithm(SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS); - - try { - //TODO SecurityConfiguration, default signature credentials - SecurityHelper.prepareSignatureParams(signature, signingCredential, null, null); - } catch (SecurityException e) { - throw new SAMLException("Error preparing signature for signing", e); - } - - samlObject.setSignature(signature); - - Marshaller assertionMarshaller = Configuration.getMarshallerFactory().getMarshaller(samlObject); - try { - assertionMarshaller.marshall(samlObject); - Signer.signObject(signature); - } catch (MarshallingException e) { - throw new SAMLException("Unable to marshall " + samlObject.getElementQName() + " for signing", e); - } catch (SignatureException e) { - throw new SAMLException("Unable to sign " + samlObject.getElementQName(), e); - } - - } - - /** - * Validated SAML object according the given validation config - * @param samlObject SAML object to validaate - * @param validatorSuiteConfig Validation config - * @throws SAMLValidationException - */ - public static void verifySAMLObjectStandardValidation(SignableSAMLObject samlObject, String validatorSuiteConfig) throws SAMLValidationException { - - ValidatorSuite validatorSuite = Configuration.getValidatorSuite(validatorSuiteConfig); - try { - validatorSuite.validate(samlObject); - } catch (ValidationException e) { - log.error(e.getMessage(), e); - throw new SAMLValidationException("Could not validate " + samlObject.getElementQName(), e); - } - - } - - /** - * Gets the STORK attribute status from a SAML attribute - * @param attribute SAML attribute - * @return STORK attribute status - */ - public static String getStatusFromAttribute(Attribute attribute) { - return attribute.getUnknownAttributes().get(STORKAttribute.DEFAULT_STORK_ATTRIBUTE_QNAME); - } - - /** - * Gets the XML value of an XML object as String - * @param xmlObj XML object - * @return XML value as String - */ - public static String getStringValueFromXMLObject(XMLObject xmlObj) { - if (xmlObj instanceof XSString) { - return ((XSString) xmlObj).getValue(); - } else if (xmlObj instanceof XSAny) { - return ((XSAny) xmlObj).getTextContent(); - } - return null; - } - - /** - * Gets the attribute value as String of an attribute whereas the attribute is in a given list - * @param attrList List of attributes - * @param name Name of the attribute where the value should be extracted - * @return attribute value as String - */ - public static String getAttributeStringValue(List attrList, String name) { - XMLObject xmlObj = getAttributeValue(attrList, name); - return getStringValueFromXMLObject(xmlObj); - } - - /** - * Gets the attribute value as String of an attribute - * @param attribute Attribute - * @return attribute value as String - */ - public static String getAttributeStringValue(Attribute attribute) { - return ((XSString) attribute.getAttributeValues().get(0)).getValue(); - } - - /** - * Gets the attribute value as anyType of an attribute - * @param attribute Attribute - * @return value as anyType - */ - public static XSAny getAttributeXSAnyValue(Attribute attribute) { - return (XSAny) attribute.getAttributeValues().get(0); - } - - /** - * Gets the attribute value as anyType of an attribute whereas the attribute is in a given list - * @param attrList List of attributes - * @param name Name of the attribute where the value should be extracted - * @return attribute value as anyType - */ - public static XSAny getXSAnyAttributeValue(List attrList, String name) { - //XMLObject xmlObj = getAttributeValue(attrList, name); - return (XSAny) getAttributeValue(attrList, name); - } - - /** - * Gets the attribute value as XMLObject of an attribute whereas the attribute is in a given list - * @param attrList List of attributes - * @param name Name of the attribute where the value should be extracted - * @return attribute value as XMLObject - */ - public static XMLObject getAttributeValue(List attrList, String name) { - Attribute attribute = getAttribute(attrList, name); - return (attribute != null && !attribute.getAttributeValues().isEmpty()) ? attribute.getAttributeValues().get(0) : null; - } - - /** - * Gets the attribute specified by name out of a list - * @param attrList List of attributes - * @param name attribute name of the attribute to extract - * @return attribute - */ - public static Attribute getAttribute(List attrList, String name) { - for (Attribute attribute : attrList) { - if (attribute.getName().equals(name)) { - return attribute; - } - } - - return null; - } - - /** - * Gets the attribute specified by name out of a list and immediately removes it from the list - * @param attrList List of attributes - * @param name attribute name of the attribute to extract and remove - * @return attribute - */ - public static String getAttributeStringValueAndRemove(List attrList, String name) { - - Attribute attribute = getAttribute(attrList, name); - String value = getAttributeStringValue(attrList, name); - attrList.remove(attribute); - - return value; - } - - /** - * Checks if an attribute with a given name is present in a SAML assertion - * @param storkAssertion STORK SAML assertion - * @param attributeName attribute name - * @return true if attribute is present - */ - public static boolean containsAttribute(Assertion storkAssertion, String attributeName) { - AttributeStatement attrStatement = storkAssertion.getAttributeStatements().get(0); - - for (Attribute attribute : attrStatement.getAttributes()) { - if (attribute.getName().equals(attributeName) && (SAMLUtil.getStatusFromAttribute(attribute) == null || SAMLUtil.getStatusFromAttribute(attribute).equals(STORKAttribute.ALLOWED_ATTRIBUTE_STATUS_AVAIL))) { - return true; - } - } - - return false; - } - - /** - * Checks if an attribute with a given name is present in a List of attributes - * @param attributeList List of attributes - * @param attributeName attribute name - * @return true if attribute is present - */ - public static boolean containsAttribute(List attributeList, String attributeName) { - for (Attribute attr : attributeList) { - if (attr.getName().equals(attributeName)) - return true; - } - return false; - } - - /** - * Remeoves attribute with a given name from an attribute list - * @param attributeList List of attributes - * @param attributeName name of the attribute to be removed from list - */ - public static void removeAttribute(List attributeList, String attributeName) { - if (containsAttribute(attributeList, attributeName)) { - attributeList.remove(getAttribute(attributeList, attributeName)); - } - } - - /** - * Gets the String value of an XML object (Only if XMLObject contains String) - * @param xmlObj XMLObject - * @return String value of XMLObject - */ - public static String getXSStringValueFromXMLObject(XMLObject xmlObj) { - if (xmlObj instanceof XSString) - return ((XSString) xmlObj).getValue(); - - return null; - } - - - /** - * Marshalls an XMLObject to an XML element (DOM) - * @param message XMLObject - * @return DOM representation of XMLObject - */ - public static Element marshallMessage(XMLObject message) { - - try { - Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(message); - if (marshaller == null) { - log.error("Unable to marshall message, no marshaller registered for message object: " - + message.getElementQName()); - } - Element messageElem = marshaller.marshall(message); - return messageElem; - } catch (MarshallingException e) { - log.error("Encountered error marshalling message to its DOM representation", e); - throw new RuntimeException("Encountered error marshalling message into its DOM representation", e); - } - } - - /** - * Unmarshalls a DOM XML element into an OpenSAML XMLObject - * @param element DOM element - * @return OpenSAML XMLObject - * @throws MessageEncodingException - */ - public static XMLObject unmarshallMessage(Element element) throws MessageEncodingException { - - try { - Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(element); - if (unmarshaller == null) { - log.error("Unable to unmarshall element, no unmarshaller registered for message element: " - + element.getNodeName()); - } - - return unmarshaller.unmarshall(element); - } catch (UnmarshallingException e) { - log.error("Encountered error unmarshalling element to its XMLObject representation", e); - throw new MessageEncodingException("Encountered error unmarshalling element to its XMLObject representation", e); - } - } - - /** - * Releases the DOM element from an XML document - * @param xmlObjList List of XMLObjects to release - * @return List of released XMLObjects - */ - public static List releaseDOM(List xmlObjList) { - - List newXMLObjList = new ArrayList(); - Iterator it = xmlObjList.iterator(); - - while (it.hasNext()) { - XMLObject xmlObj = it.next(); - xmlObj.detach(); - newXMLObjList.add(xmlObj); - } - - return newXMLObjList; - - } - - /** - * Makes a union of two RequestedAttribute lists (first list has priority and overrides attributes in the second list if equal) - * @param priorityList Priority list if attributes might be equal - * @param list low priority list - * @return Union of both lists - */ - public static List buildRequestedAttributesUnion(List priorityList, List list) { - List reqAttrList = new ArrayList(); - - if (priorityList == null || list == null) - return reqAttrList; - - if (priorityList == null || priorityList.isEmpty()) { - if (list == null || list.isEmpty()) { - return reqAttrList; - } else { - reqAttrList.addAll((List) releaseDOM(list)); - return reqAttrList; - } - } else { - if (list == null || list.isEmpty()) { - reqAttrList.addAll((List) releaseDOM(priorityList)); - return reqAttrList; - } else { - reqAttrList.addAll((List) releaseDOM(priorityList)); - for (RequestedAttribute reqAttr : list) { - boolean found = false; - for (RequestedAttribute prioReqAttr : priorityList) { - if (!prioReqAttr.getName().equals(reqAttr.getName())) { - found = true; - } - } - if (!found) { - reqAttr.detach(); - reqAttrList.add(reqAttr); - log.debug("Adding additional requested attribute: {} , isRequired: {}", reqAttr.getName(), reqAttr.isRequired()); - } - } - } - } - - return reqAttrList; - } - - /** - * Validates the signature references using OpenSAML - * @param signableObject Signable SAML Object - * @throws ValidationException thrown if references are not correct - */ - public static void validateSignatureReferences(SignableSAMLObject signableObject) throws ValidationException { - SAMLSignatureProfileValidator sigValidator = new SAMLSignatureProfileValidator(); - sigValidator.validate(signableObject.getSignature()); - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAssertionValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAssertionValidator.java deleted file mode 100644 index c412ba6a0..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAssertionValidator.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.common.SAMLVersion; -import org.opensaml.saml2.core.Assertion; -import org.opensaml.saml2.core.validator.AssertionSchemaValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkAssertionValidator extends AssertionSchemaValidator { - - /** - * Constructor - * - */ - public StorkAssertionValidator() { - - super(); - } - - @Override - public void validate(Assertion assertion) throws ValidationException { - - super.validate(assertion); - - if(assertion.getID() == null) { - - throw new ValidationException("ID is required."); - } - - if(assertion.getVersion() == null || !assertion.getVersion().equals(SAMLVersion.VERSION_20)) { - - throw new ValidationException("Version of assertion not present or invalid."); - } - - if(assertion.getIssueInstant() == null) { - - throw new ValidationException("IssueInstant is required."); - } - - if(assertion.getSubject() == null) { - - throw new ValidationException("Subject is required."); - } - - if(assertion.getConditions() == null) { - - throw new ValidationException("Conditions is required."); - } - - if(assertion.getAuthnStatements() == null || - assertion.getAuthnStatements().size() != 1) { - - throw new ValidationException("Incorrect number of AuthnStatements."); - } - - if(assertion.getAttributeStatements() != null) { - - if(assertion.getAttributeStatements().size() != 0 && - assertion.getAttributeStatements().size() != 1) { - - throw new ValidationException("Incorrect number of AttributeStatements."); - } - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAttributeValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAttributeValidator.java deleted file mode 100644 index 6e37725d1..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAttributeValidator.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import java.util.regex.Pattern; - -import org.joda.time.format.DateTimeFormat; -import org.joda.time.format.DateTimeFormatter; -import org.opensaml.saml2.core.Attribute; -import org.opensaml.saml2.core.validator.AttributeSchemaValidator; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.schema.XSString; -import org.opensaml.xml.util.AttributeMap; -import org.opensaml.xml.validation.ValidationException; - -import eu.stork.vidp.messages.common.STORKConstants; -import eu.stork.vidp.messages.saml.STORKAttribute; - -public class StorkAttributeValidator extends AttributeSchemaValidator { - - private static final String PATTERN_EIDENTIFIER = "^[A-Z]{2}/[A-Z]{2}/[A-Za-z0-9+/=\r\n]+$"; - private static final String PATTERN_GENDER = "^[MF]{1}$"; - private static final String PATTERN_COUNTRYCODEOFBIRTH = "^[A-Z]{2}|[A-Z]{4}$"; - private static final String PATTERN_COUNTRYCODE = "^[A-Z]{2}$"; - private static final String PATTERN_MARTIALSTATUS = "^[SMPDW]{1}$"; - private static final String PATTERN_EMAIL = "^[-+.\\w]{1,64}@[-.\\w]{1,64}\\.[-.\\w]{2,6}$"; - private static final String PATTERN_AGE = "^[0-9]{1,3}$"; - private static final int MAX_AGE = 120; - private static final String PATTERN_ISAGEOVER = PATTERN_AGE; - private static final String PATTERN_CITIZENQAALEVEL = "^[1-4]{1}$"; - - - /** - * Constructor - * - */ - public StorkAttributeValidator() { - - super(); - } - - @Override - public void validate(Attribute attr) throws ValidationException { - - super.validate(attr); - - if(attr.getName() == null) { - - throw new ValidationException("Name is required."); - } - - if(attr.getNameFormat() == null) { - - throw new ValidationException("NameFormat is required."); - } - - - if(attr.getUnknownAttributes() != null) { - - AttributeMap map = attr.getUnknownAttributes(); - - String value = map.get(STORKAttribute.DEFAULT_STORK_ATTRIBUTE_QNAME); - - if (value == null || value.equals(STORKAttribute.ALLOWED_ATTRIBUTE_STATUS_AVAIL)) { - //if AttributeStatus not present, default is "Available" thus AttributeValue must be present - if (attr.getAttributeValues().isEmpty()) { - //isAgeOver can have no value - if (!attr.getName().equals(STORKConstants.STORK_ATTRIBUTE_ISAGEOVER)) { - throw new ValidationException("AttributeStatus indicates that attribute is available but no AttributeValue is present."); - } - } - - //throw new ValidationException("AttributeStatus not present."); - - } else if(!value.equals(STORKAttribute.ALLOWED_ATTRIBUTE_STATUS_AVAIL) && - !value.equals(STORKAttribute.ALLOWED_ATTRIBUTE_STATUS_NOT_AVAIL) && - !value.equals(STORKAttribute.ALLOWED_ATTRIBUTE_STATUS_WITHHELD)) { - - throw new ValidationException("AttributeStatus is invalid."); - } - - } - - if (!attr.getAttributeValues().isEmpty()) { - //validate individual attributes if present - XMLObject attrValueObject = attr.getAttributeValues().get(0); - - if (!(attrValueObject instanceof XSString)) { - //Only validate String attributes - return; - } - - String value = ((XSString) attr.getAttributeValues().get(0)).getValue(); - String attrName = attr.getName(); - - //only isAgeOver can be empty if provided - if (value == null) { - //only isAgeOver can be empty if provided - if (attrName.equals(STORKConstants.STORK_ATTRIBUTE_ISAGEOVER)) { - return; - } else { - throw new ValidationException("Provided AttributeValue is empty"); - } - } - - //validate eIdentifier - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_EIDENTIFIER, PATTERN_EIDENTIFIER); - - //validate gender - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_GENDER, PATTERN_GENDER); - - //validate dateOfBirth - if (attrName.equals(STORKConstants.STORK_ATTRIBUTE_DATEOFBIRTH)) { - verifyDate(value); - } - - //validate countryCode of birth - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_COUNTRYCODEOFBIRTH, PATTERN_COUNTRYCODEOFBIRTH); - - //validate countryCode - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_NATIONALITYCODE, PATTERN_COUNTRYCODE); - - //validate martialStatus - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_MARTIALSTATUS, PATTERN_MARTIALSTATUS); - - //validate email - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_EMAIL, PATTERN_EMAIL); - - //validate age and isAgeOver - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_AGE, PATTERN_AGE); - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_ISAGEOVER, PATTERN_ISAGEOVER); - if (attr.getName().equals(STORKConstants.STORK_ATTRIBUTE_AGE) || attr.getName().equals(STORKConstants.STORK_ATTRIBUTE_ISAGEOVER)) { - if (Integer.valueOf(((XSString) attr.getAttributeValues().get(0)).getValue()) > MAX_AGE) { - throw new ValidationException("Maximum age reached"); - } - } - - validateAttributeValueFormat(value, attrName, STORKConstants.STORK_ATTRIBUTE_CITIZENQAALEVEL, PATTERN_CITIZENQAALEVEL); - } - - } - - private void validateAttributeValueFormat(String value, String currentAttrName, String attrNameToTest, String pattern) throws ValidationException { - if (currentAttrName.equals(attrNameToTest)) { - if (!Pattern.matches(pattern, value)) { - throw new ValidationException(attrNameToTest + " has incorrect format."); - } - } - - } - - private static void verifyDate(String pepsDate) throws ValidationException { - DateTimeFormatter fmt = null; - - switch (pepsDate.length()) { - case 4: - fmt = DateTimeFormat.forPattern("yyyy"); - break; - case 6: - fmt = DateTimeFormat.forPattern("yyyyMM"); - break; - case 8: - fmt = DateTimeFormat.forPattern("yyyyMMdd"); - break; - default: - throw new ValidationException("Date has wrong format"); - } - - try { - fmt.parseDateTime(pepsDate); - } catch (IllegalArgumentException e) { - throw new ValidationException("Date has wrong format"); - } - - - } - - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAudienceRestrictionValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAudienceRestrictionValidator.java deleted file mode 100644 index a561d4c33..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAudienceRestrictionValidator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.AudienceRestriction; -import org.opensaml.saml2.core.validator.AudienceRestrictionSchemaValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkAudienceRestrictionValidator extends - AudienceRestrictionSchemaValidator { - - /** - * Constructor - * - */ - public StorkAudienceRestrictionValidator() { - - super(); - } - - @Override - public void validate(AudienceRestriction res) throws ValidationException { - - super.validate(res); - - if(res.getAudiences() == null || res.getAudiences().size() < 1) { - - throw new ValidationException("Audience is required."); - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthenticationAttributesValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthenticationAttributesValidator.java deleted file mode 100644 index 1997da7b6..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthenticationAttributesValidator.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.AuthenticationAttributes; -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -public class StorkAuthenticationAttributesValidator implements Validator { - - - public StorkAuthenticationAttributesValidator() { - - } - - public void validate(AuthenticationAttributes authenticationAttributes) throws ValidationException { - - //check AuthenticationAttributes for VIDPs - VIDPAuthenticationAttributes vidpAuthenticationAttributes = authenticationAttributes.getVIDPAuthenticationAttributes(); - - if(vidpAuthenticationAttributes == null) { - - throw new ValidationException("VIDPAuthenticationAttributes is required for sending requests to VIDPs."); - } - - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthnRequestValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthnRequestValidator.java deleted file mode 100644 index 0e8722d55..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthnRequestValidator.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.common.SAMLVersion; -import org.opensaml.saml2.core.AuthnRequest; -import org.opensaml.saml2.core.validator.AuthnRequestSchemaValidator; -import org.opensaml.xml.util.XMLHelper; -import org.opensaml.xml.validation.ValidationException; - -import eu.stork.mw.messages.saml.STORKAuthnRequest; - -public class StorkAuthnRequestValidator extends AuthnRequestSchemaValidator { - - private static final String ALLOWED_CONSENT = "urn:oasis:names:tc:SAML:2.0:consent:unspecified"; - private static final String ALLOWED_PROTOCOL_BINDING_1 = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"; - private static final String ALLOWED_PROTOCOL_BINDING_2 = "urn:oasis:names:tc:SAML:2.0:bindings:SOAP"; - - private static final int MAX_SIZE = 131072; - - /** - * Constructor - * - */ - public StorkAuthnRequestValidator() { - - super(); - } - - @Override - public void validate(AuthnRequest req) throws ValidationException { - - if (XMLHelper.prettyPrintXML(req.getDOM()).getBytes().length > MAX_SIZE) { - throw new ValidationException("SAML AuthnRequest exceeds max size."); - } - - super.validate(req); - - STORKAuthnRequest request = (STORKAuthnRequest) req; - - if (request.getID() == null) { - - throw new ValidationException("ID is required."); - } - - if (request.getVersion() == null) { - - throw new ValidationException("Version is required."); - } else { - - if (!request.getVersion().equals(SAMLVersion.VERSION_20)) { - - throw new ValidationException("Version is invalid."); - } - } - - if (request.getIssueInstant() == null) { - - throw new ValidationException("IssueInstant is required."); - } - - if (request.getConsent() != null) { - - if (!request.getConsent().equals(ALLOWED_CONSENT)) { - - throw new ValidationException("Consent is invalid."); - } - } - - if (request.isForceAuthn() == null) { - - throw new ValidationException("ForceAuthn is required."); - } else if (!request.isForceAuthn()) { - - throw new ValidationException("ForceAuthn is invalid."); - } - - if (request.isPassive() == null) { - - throw new ValidationException("IsPassive is required."); - } else if (request.isPassive()) { - - throw new ValidationException("IsPassive is invalid."); - } - - if (request.getProtocolBinding() == null) { - - throw new ValidationException("ProtocolBinding is required."); - } else { - if (!request.getProtocolBinding() - .equals(ALLOWED_PROTOCOL_BINDING_1) - && !request.getProtocolBinding().equals( - ALLOWED_PROTOCOL_BINDING_2)) { - - throw new ValidationException("ProtocolBinding is invalid."); - } - - } - - if(request.getAssertionConsumerServiceURL() == null) { - - throw new ValidationException("AssertionConsumerServiceURL is required."); - } - - if(request.getProviderName() == null) { - - throw new ValidationException("ProviderName is required."); - } - - - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthnStatementValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthnStatementValidator.java deleted file mode 100644 index b25b5621f..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkAuthnStatementValidator.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.AuthnStatement; -import org.opensaml.saml2.core.validator.AuthnStatementSchemaValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkAuthnStatementValidator extends - AuthnStatementSchemaValidator { - - /** - * Constructor - * - */ - public StorkAuthnStatementValidator() { - - super(); - } - - @Override - public void validate(AuthnStatement stmnt) throws ValidationException { - - super.validate(stmnt); - - if(stmnt.getAuthnInstant() == null) { - - throw new ValidationException("AuthnInstant is required."); - } - - if(stmnt.getSubjectLocality() == null) { - - throw new ValidationException("SubjectLocality is required."); - } - - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkCitizenCountryCodeValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkCitizenCountryCodeValidator.java deleted file mode 100644 index 15f8e2dd1..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkCitizenCountryCodeValidator.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import java.util.regex.Pattern; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.CitizenCountryCode; - -public class StorkCitizenCountryCodeValidator implements - Validator { - - public static final String REGEX_PATTERN = "^[A-Za-z]{2}$"; - - public StorkCitizenCountryCodeValidator() { - - } - - public void validate(CitizenCountryCode ccc) throws ValidationException { - - if(ccc == null) { - - throw new ValidationException("CitizenCountryCode is required."); - } - - if (ccc.getValue() == null) { - throw new ValidationException("CitizenCountryCode has no value"); - } - - - if (!Pattern.matches(REGEX_PATTERN, ccc.getValue())) { - throw new ValidationException("CitizenCountryCode not valid: " + ccc.getValue()); - } - - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkConditionsValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkConditionsValidator.java deleted file mode 100644 index 81b7957fd..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkConditionsValidator.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.Conditions; -import org.opensaml.saml2.core.validator.ConditionsSpecValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkConditionsValidator extends ConditionsSpecValidator { - - /** - * Constructor - * - */ - public StorkConditionsValidator() { - - super(); - } - - @Override - public void validate(Conditions conditions) throws ValidationException { - - super.validate(conditions); - - if(conditions.getNotBefore() == null) { - - throw new ValidationException("NotBefore is required."); - } - - if(conditions.getNotOnOrAfter() == null) { - - throw new ValidationException("NotOnOrAfter is required."); - } - - if(conditions.getAudienceRestrictions() == null || conditions.getAudienceRestrictions().size() < 1) { - - throw new ValidationException("AudienceRestriction is required."); - } - - if(conditions.getOneTimeUse() == null) { - - throw new ValidationException("OneTimeUse is required."); - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEIDSectorShareValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEIDSectorShareValidator.java deleted file mode 100644 index 96555e660..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEIDSectorShareValidator.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -/** - * - */ -package eu.stork.vidp.messages.validation; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.EIDSectorShare; - -/** - * @author bzwattendorfer - * - */ -public class StorkEIDSectorShareValidator implements Validator { - - public StorkEIDSectorShareValidator() { - - } - - public void validate(EIDSectorShare eidSectorShare) throws ValidationException { - - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEncryptedAttributeValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEncryptedAttributeValidator.java deleted file mode 100644 index 48464b6ec..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEncryptedAttributeValidator.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.EncryptedAttribute; -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -public class StorkEncryptedAttributeValidator implements - Validator { - - public StorkEncryptedAttributeValidator() { - - } - - public void validate(EncryptedAttribute encAttr) throws ValidationException { - - if(encAttr.getEncryptedData() == null) { - - throw new ValidationException("EncryptedData is required."); - } - - - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEncryptedIdValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEncryptedIdValidator.java deleted file mode 100644 index 79450b1dc..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkEncryptedIdValidator.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.EncryptedID; -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -public class StorkEncryptedIdValidator implements Validator { - - /** - * Constructor - * - */ - public StorkEncryptedIdValidator() { - - } - - public void validate(EncryptedID encId) throws ValidationException { - - if(encId.getEncryptedData() == null) { - - throw new ValidationException("EncryptedData is required."); - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkExtensionsValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkExtensionsValidator.java deleted file mode 100644 index 21b247071..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkExtensionsValidator.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import java.util.List; - -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.saml.STORKExtensions; -import eu.stork.vidp.messages.stork.AuthenticationAttributes; -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; - -public class StorkExtensionsValidator implements Validator { - - - public StorkExtensionsValidator() { - - } - - public void validate(STORKExtensions ext) throws ValidationException { - - // check QAALevel - List qaaList = ext.getUnknownXMLObjects(QualityAuthenticationAssuranceLevel.DEFAULT_ELEMENT_NAME); - - if(qaaList == null || qaaList.size() != 1) { - - throw new ValidationException("QAALevel is required."); - } - - //check AuthenticationAttributes for VIDPs -// AuthenticationAttributes authenticationAttributes = ext.getAuthenticationAttributes(); -// -// if(authenticationAttributes == null) { -// -// throw new ValidationException("AuthenticationAttributes is required for sending requests to VIDPs."); -// } - - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkIssuerValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkIssuerValidator.java deleted file mode 100644 index df32ee6ad..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkIssuerValidator.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.Issuer; -import org.opensaml.saml2.core.validator.IssuerSchemaValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkIssuerValidator extends IssuerSchemaValidator { - - private static final String FORMAT_ALLOWED_VALUE = "urn:oasis:names:tc:SAML:2.0:nameid-format:entity"; - - /** - * Constructor - * - */ - public StorkIssuerValidator() { - - super(); - } - - @Override - public void validate(Issuer issuer) throws ValidationException { - - super.validate(issuer); - - // format is optional - if(issuer.getFormat() != null) { - - if(!issuer.getFormat().equals(FORMAT_ALLOWED_VALUE)) { - - throw new ValidationException("Format has an invalid value."); - } - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkNameIDValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkNameIDValidator.java deleted file mode 100644 index 85fbeff17..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkNameIDValidator.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.NameID; -import org.opensaml.saml2.core.validator.NameIDSchemaValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkNameIDValidator extends NameIDSchemaValidator { - - private static final String FORMAT_ALLOWED_VALUE = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"; - private static final String FORMAT_ALLOWED_VALUE_OLD = "urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified"; - - /** - * Constructor - * - */ - public StorkNameIDValidator() { - - super(); - } - - @Override - public void validate(NameID nameID) throws ValidationException { - - super.validate(nameID); - - if (nameID.getNameQualifier() == null) { - - throw new ValidationException("NameQualifier is required."); - } - - if (nameID.getFormat() == null) { - - throw new ValidationException("Format is required."); - - } else if(!(nameID.getFormat().equals(FORMAT_ALLOWED_VALUE) || nameID.getFormat().equals(FORMAT_ALLOWED_VALUE_OLD))) { - - throw new ValidationException("Format is invalid."); - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkNameIdPolicyValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkNameIdPolicyValidator.java deleted file mode 100644 index 7d98b5e60..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkNameIdPolicyValidator.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.NameIDPolicy; -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -public class StorkNameIdPolicyValidator implements Validator { - - public StorkNameIdPolicyValidator() { - - } - - public void validate(NameIDPolicy nameIDPolicy) throws ValidationException { - - - if(nameIDPolicy.getAllowCreate() != null) { - - if(!nameIDPolicy.getAllowCreate()) { - - throw new ValidationException("AllowCreate is invalid."); - } - } - - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkQualityAuthenticationAssuranceLevelValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkQualityAuthenticationAssuranceLevelValidator.java deleted file mode 100644 index 5c23fe04b..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkQualityAuthenticationAssuranceLevelValidator.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.QualityAuthenticationAssuranceLevel; - -public class StorkQualityAuthenticationAssuranceLevelValidator implements - Validator { - - - private static final int MIN_VAL = 1; - private static final int MAX_VAL = 4; - - public StorkQualityAuthenticationAssuranceLevelValidator() { - - } - - public void validate(QualityAuthenticationAssuranceLevel qaaLevel) - throws ValidationException { - - if(qaaLevel.getValue() < MIN_VAL || qaaLevel.getValue() > MAX_VAL) { - - throw new ValidationException("QAALevel is invalid."); - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkRequestedAttributeValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkRequestedAttributeValidator.java deleted file mode 100644 index b9b26a38a..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkRequestedAttributeValidator.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import java.util.regex.Pattern; - -import org.opensaml.saml2.metadata.RequestedAttribute; -import org.opensaml.saml2.metadata.validator.RequestedAttributeSchemaValidator; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.schema.XSAny; -import org.opensaml.xml.schema.XSString; -import org.opensaml.xml.validation.ValidationException; - -import eu.stork.vidp.messages.common.STORKConstants; - -public class StorkRequestedAttributeValidator extends - RequestedAttributeSchemaValidator { - - private static final String PATTERN_ISAGEOVER = "^[0-9]{1,3}$"; - - public StorkRequestedAttributeValidator() { - - super(); - } - - @Override - public void validate(RequestedAttribute attr) throws ValidationException { - - super.validate(attr); - - if (attr.getName() == null) { - - throw new ValidationException("Name is required."); - } - - if (attr.getNameFormat() == null) { - - throw new ValidationException("NameFormat is required."); - } - - if (!STORKConstants.FULL_STORK_ATTRIBUTE_SET.contains(attr.getName()) && attr.isRequired()) { - throw new ValidationException("Unknown attribute " + attr.getName() + " requested mandatory."); - } - - if (attr.getName().equals(STORKConstants.STORK_ATTRIBUTE_ISAGEOVER)) { - if (attr.getAttributeValues().isEmpty()) { - throw new ValidationException("isAgeOver requires attribute value"); - } - - XMLObject attrValueObject = attr.getAttributeValues().get(0); - - if (attrValueObject instanceof XSString) { - if (!Pattern.matches(PATTERN_ISAGEOVER, ((XSString) attr.getAttributeValues().get(0)).getValue())) { - throw new ValidationException("Value for isAgeOver has incorrect format."); - } - } else if (attrValueObject instanceof XSAny) { - if (!Pattern.matches(PATTERN_ISAGEOVER, ((XSAny) attrValueObject).getTextContent())) { - throw new ValidationException("Value for isAgeOver has incorrect format."); - } - - } else { - throw new ValidationException("Value for isAgeOver has incorrect format."); - } - - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkRequestedAttributesValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkRequestedAttributesValidator.java deleted file mode 100644 index 0324079f3..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkRequestedAttributesValidator.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.RequestedAttributes; - -public class StorkRequestedAttributesValidator implements - Validator { - - public StorkRequestedAttributesValidator() { - - } - - public void validate(RequestedAttributes attrs) throws ValidationException { - - // empty so far - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkResponseValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkResponseValidator.java deleted file mode 100644 index 8028173fa..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkResponseValidator.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.common.SAMLVersion; -import org.opensaml.saml1.core.StatusCode; -import org.opensaml.saml2.core.Response; -import org.opensaml.saml2.core.validator.ResponseSchemaValidator; -import org.opensaml.xml.util.XMLHelper; -import org.opensaml.xml.validation.ValidationException; - -import eu.stork.mw.messages.saml.STORKResponse; - -public class StorkResponseValidator extends ResponseSchemaValidator { - - private static final String CONSENT_ALLOWED_VALUE_1 = "urn:oasis:names:tc:SAML:2.0:consent:obtained"; - private static final String CONSENT_ALLOWED_VALUE_2 = "urn:oasis:names:tc:SAML:2.0:consent:prior"; - private static final String CONSENT_ALLOWED_VALUE_3 = "urn:oasis:names:tc:SAML:2.0:consent:curent-implicit"; - private static final String CONSENT_ALLOWED_VALUE_4 = "urn:oasis:names:tc:SAML:2.0:consent:curent-explicit"; - private static final String CONSENT_ALLOWED_VALUE_5 = "urn:oasis:names:tc:SAML:2.0:consent:unspecified"; - - private static final int MAX_SIZE = 131072; - - /** - * Constructor - * - */ - public StorkResponseValidator() { - - super(); - } - - /** {@inheritDoc} */ - public void validate(Response response) throws ValidationException { - - if (XMLHelper.prettyPrintXML(response.getDOM()).getBytes().length > MAX_SIZE) { - throw new ValidationException("SAML Response exceeds max size."); - } - - super.validate(response); - - STORKResponse resp = (STORKResponse) response; - - if (resp.getID() == null) { - - throw new ValidationException("ID is required"); - } - - if (resp.getInResponseTo() == null) { - - throw new ValidationException("InResponseTo is required"); - } - - if (resp.getVersion() == null) { - - throw new ValidationException("Version is required."); - } else if(!resp.getVersion().equals(SAMLVersion.VERSION_20)) { - - throw new ValidationException("Version is invalid."); - } - - if (resp.getIssueInstant() == null) { - - throw new ValidationException("IssueInstant is required"); - } - - if (resp.getDestination() == null) { - - throw new ValidationException("Destination is required"); - } - - // Consent is optional - if (resp.getConsent() != null) { - - String consent = resp.getConsent(); - - if (!consent.equals(CONSENT_ALLOWED_VALUE_1) - && !consent.equals(CONSENT_ALLOWED_VALUE_2) - && !consent.equals(CONSENT_ALLOWED_VALUE_3) - && !consent.equals(CONSENT_ALLOWED_VALUE_4) - && !consent.equals(CONSENT_ALLOWED_VALUE_5)) { - - throw new ValidationException("Consent is invalid."); - } - } - - - if (resp.getIssuer() == null) { - - throw new ValidationException("Issuer is required."); - } - - if (resp.getStatus() == null) { - - throw new ValidationException("Status is required."); - } - - - if(resp.getSignature() == null) { - - throw new ValidationException("Signature is required."); - } - - - if (resp.getStatus().getStatusCode().getValue().equals(StatusCode.SUCCESS)) { - if (resp.getAssertions() == null || resp.getAssertions().size() == 0) { - - throw new ValidationException("Assertion is required"); - } - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSPIDValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSPIDValidator.java deleted file mode 100644 index a42d7a453..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSPIDValidator.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.SPID; - -public class StorkSPIDValidator implements Validator { - - public static final int MIN_SIZE = 1; - public static final int MAX_SIZE = 40; - - public StorkSPIDValidator() { - - } - - public void validate(SPID spid) throws ValidationException { - - - if(spid == null) { - - throw new ValidationException("SPID value is required."); - } - - if(spid != null) { - - if (spid.getValue() == null) { - throw new ValidationException("SPID has no value"); - } - - if (spid.getValue().length() <= MIN_SIZE || spid.getValue().length() > MAX_SIZE) { - throw new ValidationException("SPID has wrong size: " + spid.getValue().length()); - } - } - - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSPInformationValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSPInformationValidator.java deleted file mode 100644 index 9c54fd620..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSPInformationValidator.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.SPInformation; - -public class StorkSPInformationValidator implements Validator { - - public StorkSPInformationValidator() { - - } - - public void validate(SPInformation spi) throws ValidationException { - - if(spi.getSPID() == null) { - - throw new ValidationException("SPID is required."); - } - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpApplicationValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpApplicationValidator.java deleted file mode 100644 index 08551e03e..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpApplicationValidator.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.SpApplication; - -public class StorkSpApplicationValidator implements - Validator { - - public static final int MIN_SIZE = 1; - public static final int MAX_SIZE = 100; - //public static final String REGEX_PATTERN = "^[a-zA-Z0-9]{1,30}$"; - - public StorkSpApplicationValidator() { - - } - - public void validate(SpApplication spApplication) throws ValidationException { - - if(spApplication != null) { - - if (spApplication.getValue() == null) { - throw new ValidationException("spApplication has no value"); - } - -// if (!Pattern.matches(REGEX_PATTERN, spApplication.getValue())) { -// throw new ValidationException("spApplication has wrong format: " + spApplication.getValue()); -// } - - if (spApplication.getValue().length() < MIN_SIZE || spApplication.getValue().length() > MAX_SIZE) { - throw new ValidationException("spApplication has wrong size: " + spApplication.getValue().length()); - } - - } - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpCountryValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpCountryValidator.java deleted file mode 100644 index e6ae0f1b7..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpCountryValidator.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import java.util.regex.Pattern; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.SpCountry; - -public class StorkSpCountryValidator implements - Validator { - - public static final String REGEX_PATTERN = "^[A-Z]{2}$"; - - public StorkSpCountryValidator() { - - } - - public void validate(SpCountry spCountry) throws ValidationException { - - if(spCountry != null) { - - if (spCountry.getValue() == null) { - throw new ValidationException("spCountry has no value"); - } - - if (!Pattern.matches(REGEX_PATTERN, spCountry.getValue())) { - throw new ValidationException("spCountry not valid: " + spCountry.getValue()); - } - } - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpInstitutionValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpInstitutionValidator.java deleted file mode 100644 index 9d50d9122..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpInstitutionValidator.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.SpInstitution; - -public class StorkSpInstitutionValidator implements - Validator { - - public static final int MIN_SIZE = 1; - public static final int MAX_SIZE = 50; - //public static final String REGEX_PATTERN = "^[a-zA-Z0-9]{1,50}$"; - - public StorkSpInstitutionValidator() { - - } - - public void validate(SpInstitution spInstitution) throws ValidationException { - - if(spInstitution != null) { - - if (spInstitution.getValue() == null) { - throw new ValidationException("spInstitution has no value"); - } - -// if (!Pattern.matches(REGEX_PATTERN, spApplication.getValue())) { -// throw new ValidationException("spApplication has wrong format: " + spApplication.getValue()); -// } - - if (spInstitution.getValue().length() < MIN_SIZE || spInstitution.getValue().length() > MAX_SIZE) { - throw new ValidationException("spInstitution has wrong size: " + spInstitution.getValue().length()); - } - } - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpSectorValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpSectorValidator.java deleted file mode 100644 index 2cfaa7a4c..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSpSectorValidator.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import java.util.regex.Pattern; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.SpSector; - -public class StorkSpSectorValidator implements - Validator { - - public static final int MIN_SIZE = 1; - public static final int MAX_SIZE = 20; - //public static final String REGEX_PATTERN = "^[a-zA-Z0-9]{1,30}$"; - - public StorkSpSectorValidator() { - - } - - public void validate(SpSector spSector) throws ValidationException { - - if(spSector != null) { - - if (spSector.getValue() == null) { - throw new ValidationException("spSector has no value"); - } - -// if (!Pattern.matches(REGEX_PATTERN, spSector.getValue())) { -// throw new ValidationException("spSector has wrong format: " + spSector.getValue()); -// } - - if (spSector.getValue().length() < MIN_SIZE || spSector.getValue().length() > MAX_SIZE) { - throw new ValidationException("spApplication has wrong size: " + spSector.getValue().length()); - } - - } - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkStatusCodeValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkStatusCodeValidator.java deleted file mode 100644 index 3ee214c46..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkStatusCodeValidator.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.Status; -import org.opensaml.saml2.core.StatusCode; -import org.opensaml.saml2.core.validator.StatusCodeSchemaValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkStatusCodeValidator extends StatusCodeSchemaValidator { - - // supported values according to SAML v2.0 specification - private static String[] ALLOWED_FIRST_LEVEL_STATUS_CODE_VALUES = new String[] { - "urn:oasis:names:tc:SAML:2.0:status:Success", - "urn:oasis:names:tc:SAML:2.0:status:Requester", - "urn:oasis:names:tc:SAML:2.0:status:Responder", - "urn:oasis:names:tc:SAML:2.0:status:VersionMismatch"}; - - private static String[] ALLOWED_SECOND_LEVEL_STATUS_CODE_VALUES = new String[] { - "urn:oasis:names:tc:SAML:2.0:status:AuthnFailed", - "urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue", - "urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy", - "urn:oasis:names:tc:SAML:2.0:status:NoAuthnContext", - "urn:oasis:names:tc:SAML:2.0:status:NoAvailableIDP", - "urn:oasis:names:tc:SAML:2.0:status:NoPassive", - "urn:oasis:names:tc:SAML:2.0:status:NoSupportedIDP", - "urn:oasis:names:tc:SAML:2.0:status:PartialLogout", - "urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded", - "urn:oasis:names:tc:SAML:2.0:status:RequestDenied", - "urn:oasis:names:tc:SAML:2.0:status:RequestUnsupported", - "urn:oasis:names:tc:SAML:2.0:status:RequestVersionDeprecated", - "urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooHigh", - "urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooLow", - "urn:oasis:names:tc:SAML:2.0:status:ResourceNotRecognized", - "urn:oasis:names:tc:SAML:2.0:status:TooManyResponses", - "urn:oasis:names:tc:SAML:2.0:status:UnknownAttrProfile", - "urn:oasis:names:tc:SAML:2.0:status:UnknownPrincipal", - "urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding", - "http://www.stork.gov.eu/saml20/statusCodes/QAANotSupported" - }; - - /** - * Constructor - * - */ - public StorkStatusCodeValidator() { - - super(); - } - - @Override - public void validate(StatusCode statusCode) throws ValidationException { - - super.validate(statusCode); - - - if(statusCode.getValue() == null) { - - throw new ValidationException("StatusCode is required"); - } - - boolean valid = false; - - if (statusCode.getParent() instanceof Status) { - //first level Status Codes - - String value = statusCode.getValue(); - - - - - for(String allowedVal : ALLOWED_FIRST_LEVEL_STATUS_CODE_VALUES) { - - if(value.equals(allowedVal)) { - - valid = true; - break; - } - } - - if(!valid) { - - throw new ValidationException("First Level StatusCode has an invalid value."); - } - } else { - //parent is status code - //second level Status Codes - - if(statusCode != null) { - - valid = false; - - String subVal = statusCode.getValue(); - - for(String allowedVal : ALLOWED_SECOND_LEVEL_STATUS_CODE_VALUES) { - - if(subVal.equals(allowedVal)) { - - valid = true; - break; - } - } - - if(!valid) { - - throw new ValidationException("Second Level StatusCode has an invalid value."); - } - - } - - } - } - - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkStatusValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkStatusValidator.java deleted file mode 100644 index 36d7ffab5..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkStatusValidator.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.Status; -import org.opensaml.saml2.core.validator.StatusSchemaValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkStatusValidator extends StatusSchemaValidator { - - /** - * Constructor - * - */ - public StorkStatusValidator() { - - super(); - } - - @Override - public void validate(Status status) throws ValidationException { - - super.validate(status); - - if(status.getStatusCode() == null) { - - throw new ValidationException("StatusCode is required."); - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectConfirmationValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectConfirmationValidator.java deleted file mode 100644 index 0f1fad295..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectConfirmationValidator.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.opensaml.saml2.core.SubjectConfirmation; -import org.opensaml.saml2.core.SubjectConfirmationData; -import org.opensaml.saml2.core.validator.SubjectConfirmationSchemaValidator; -import org.opensaml.xml.XMLObject; -import org.opensaml.xml.signature.X509Data; -import org.opensaml.xml.validation.ValidationException; - -public class StorkSubjectConfirmationValidator extends - SubjectConfirmationSchemaValidator { - - private static final String ALLOWED_METHOD_1 = "urn:oasis:names:tc:SAML:2.0:cm:bearer"; - private static final String ALLOWED_METHOD_2 = "oasis:names:tc:SAML:2.0:cm:holder-of-key"; - - /** - * Constructor - * - */ - public StorkSubjectConfirmationValidator() { - - super(); - } - - @Override - public void validate(SubjectConfirmation subjectConfirmation) - throws ValidationException { - - super.validate(subjectConfirmation); - - String method = subjectConfirmation.getMethod(); - - if (!(method.equals(ALLOWED_METHOD_1) || method.equals(ALLOWED_METHOD_2))) { - throw new ValidationException("Method is invalid."); - } - - if (subjectConfirmation.getSubjectConfirmationData() == null) { - throw new ValidationException("SubjectConfirmationData required."); - - } - - SubjectConfirmationData confData = subjectConfirmation.getSubjectConfirmationData(); - - - if (method.equals(ALLOWED_METHOD_1)) { - if (confData.getNotBefore() != null) { - throw new ValidationException("NotBefore in SubjectConfirmationData not allowed if confirmation method is \"bearer\"."); - } - - } - - if (confData.getNotOnOrAfter() == null) { - - throw new ValidationException("NotOnOrAfter is required."); - } - - if (confData.getRecipient() == null) { - - throw new ValidationException("Recipient is required."); - } - - if (confData.getInResponseTo() == null) { - - throw new ValidationException("InResponseTo is required."); - } - - if(method.equals(ALLOWED_METHOD_2)) { - - List childrenKeyInfo = confData.getUnknownXMLObjects(new QName("KeyInfo")); - - if(childrenKeyInfo.size() < 1) { - - throw new ValidationException("KeyInfo is required."); - } - - List childrenKeyData = confData.getUnknownXMLObjects(new QName("X509Data")); - - if(childrenKeyData.size() != 1) { - - throw new ValidationException("Invalid number of X509Data elements."); - } else { - - X509Data data = (X509Data)childrenKeyData.get(0); - - if(data.getX509Certificates() == null || data.getX509Certificates().size() < 1 ) { - - throw new ValidationException("X509Certificate is required."); - } - - } - - } - - - - } - - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectLocalityValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectLocalityValidator.java deleted file mode 100644 index 33c7b4478..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectLocalityValidator.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.SubjectLocality; -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -public class StorkSubjectLocalityValidator implements - Validator { - - public StorkSubjectLocalityValidator() { - - } - - public void validate(SubjectLocality sloc) throws ValidationException { - - if (sloc.getAddress() == null) { - - throw new ValidationException("Address is required."); - } - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectValidator.java deleted file mode 100644 index 077b6294a..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkSubjectValidator.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.saml2.core.Subject; -import org.opensaml.saml2.core.validator.SubjectSchemaValidator; -import org.opensaml.xml.validation.ValidationException; - -public class StorkSubjectValidator extends SubjectSchemaValidator { - - /** - * Constructor - * - */ - public StorkSubjectValidator() { - - super(); - } - - @Override - public void validate(Subject subject) throws ValidationException { - - super.validate(subject); - - if(subject.getNameID() == null && subject.getEncryptedID() == null) { - - throw new ValidationException("Neither NameID nor EncryptedID is provided."); - } - - if(subject.getSubjectConfirmations() == null || subject.getSubjectConfirmations().size() < 1) { - - throw new ValidationException("SubjectConfirmation is required."); - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkVIDPAuthenticationAttributesValidator.java b/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkVIDPAuthenticationAttributesValidator.java deleted file mode 100644 index 88ff7bed4..000000000 --- a/id/server/stork-saml-engine/src/main/java/eu/stork/vidp/messages/validation/StorkVIDPAuthenticationAttributesValidator.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2011 by Graz University of Technology, Austria - * The Austrian STORK Modules have been developed by the E-Government - * Innovation Center EGIZ, a joint initiative of the Federal Chancellery - * Austria and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package eu.stork.vidp.messages.validation; - -import org.opensaml.xml.validation.ValidationException; -import org.opensaml.xml.validation.Validator; - -import eu.stork.vidp.messages.stork.VIDPAuthenticationAttributes; - -public class StorkVIDPAuthenticationAttributesValidator implements - Validator { - - public StorkVIDPAuthenticationAttributesValidator() { - - } - - public void validate(VIDPAuthenticationAttributes attr) - throws ValidationException { - - - if(attr.getCitizenCountryCode() == null) { - - throw new ValidationException("CitizenCountryCode is required."); - } - - - if(attr.getSPInformation() == null) { - - throw new ValidationException("SPInformation is required."); - } - - } - -} diff --git a/id/server/stork-saml-engine/src/main/resources/saml2-post-binding-moa.vm b/id/server/stork-saml-engine/src/main/resources/saml2-post-binding-moa.vm deleted file mode 100644 index cac0bda76..000000000 --- a/id/server/stork-saml-engine/src/main/resources/saml2-post-binding-moa.vm +++ /dev/null @@ -1,38 +0,0 @@ -## -## Velocity Template for SAML 2 HTTP-POST binding -## -## Velocity context may contain the following properties -## action - String - the action URL for the form -## RelayState - String - the relay state for the message -## SAMLRequest - String - the Base64 encoded SAML Request -## SAMLResponse - String - the Base64 encoded SAML Response -## Contains target attribute to delegate PEPS authentication out of iFrame - - - - - - -
-
- #if($RelayState)#end - - #if($SAMLRequest)#end - - #if($SAMLResponse)#end - -
- -
- - - \ No newline at end of file diff --git a/id/server/stork-saml-engine/src/main/resources/saml2-stork-config.xml b/id/server/stork-saml-engine/src/main/resources/saml2-stork-config.xml deleted file mode 100644 index 988480f55..000000000 --- a/id/server/stork-saml-engine/src/main/resources/saml2-stork-config.xml +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file -- cgit v1.2.3 From 5ee3da37829fa14d70ad827e19364be4800fab37 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Fri, 31 Jan 2014 08:55:04 +0100 Subject: fixed target type for MIS info --- .../moa/id/auth/AuthenticationServer.java | 17 +++++++++-------- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 18 +++++++++++++++++- .../moa/id/auth/stork/STORKResponseProcessor.java | 21 +++++++++++---------- 3 files changed, 37 insertions(+), 19 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 60b269059..94cab53d4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1710,7 +1710,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws SZRGWClientException */ - public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String gender, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType, String target, String oaFriendlyName, String filters) throws SZRGWClientException { + public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String gender, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType, String targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException { try { AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); @@ -1739,7 +1739,8 @@ public class AuthenticationServer implements MOAIDAuthConstants { MISType mis = new MISType(); Target targetObject = new Target(); - targetObject.setValue(target); + targetObject.setType(targetType); + targetObject.setValue(targetValue); mis.setTarget(targetObject); mis.setOAFriendlyName(oaFriendlyName); @@ -1777,7 +1778,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws ConfigurationException the configuration exception */ public CreateIdentityLinkResponse getIdentityLink(Element signature) throws SZRGWClientException, ConfigurationException { - return getIdentityLink(null, null, null, null, null, XMLHelper.nodeToString(signature), null, null, null); + return getIdentityLink(null, null, null, null, XMLHelper.nodeToString(signature)); } /** @@ -1793,7 +1794,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws ConfigurationException the configuration exception */ public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String signature) throws SZRGWClientException { - return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, null, signature, null, null, null); + return getIdentityLink(PEPSIdentifier, PEPSFirstname, PEPSFamilyname, PEPSDateOfBirth, null, signature, null, null, null, null, null, null, null); } /** @@ -1810,10 +1811,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { */ public CreateIdentityLinkResponse getIdentityLink(String citizenSignature, String representative, String represented, String mandateContent, - String organizationAddress, String organizationType, String target, String oaFriendlyName, String filters) throws SZRGWClientException { + String organizationAddress, String organizationType, String targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException { return getIdentityLink(null, null, null, null, null, citizenSignature, represented, representative, mandateContent, organizationAddress, - organizationType, target, oaFriendlyName, filters); + organizationType, targetType, targetValue, oaFriendlyName, filters); } /** @@ -1833,10 +1834,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { public CreateIdentityLinkResponse getIdentityLink(String eIdentifier, String givenName, String lastName, String dateOfBirth, String gender, String citizenSignature, String representative, String represented, - String mandate, String target, String oaFriendlyName, String filters) throws SZRGWClientException { + String mandate, String targetType, String targetValue, String oaFriendlyName, String filters) throws SZRGWClientException { return getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, representative, represented, mandate, null, - null, target, oaFriendlyName, filters); + null, targetType, targetValue, oaFriendlyName, filters); } /** diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index bd8c6420d..9dfce7838 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -200,6 +200,22 @@ public class PEPSConnectorServlet extends AuthServlet { OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix()); if (oaParam == null) throw new AuthenticationException("auth.00", new Object[] { moasession.getPublicOAURLPrefix() }); + + // retrieve target + //TODO: check in case of SSO!!! + String targetType = null; + String targetValue = null; + if(oaParam.getBusinessService()) { + String id = oaParam.getIdentityLinkDomainIdentifier(); + if (id.startsWith(AuthenticationSession.REGISTERANDORDNR_PREFIX_)) + targetValue = id.substring(AuthenticationSession.REGISTERANDORDNR_PREFIX_.length()); + else + targetValue = moasession.getDomainIdentifier(); + targetType = AuthenticationSession.REGISTERANDORDNR_PREFIX_; + } else { + targetType = AuthenticationSession.TARGET_PREFIX_; + targetValue = oaParam.getTarget(); + } Logger.debug("Starting connecting SZR Gateway"); //contact SZR Gateway @@ -207,7 +223,7 @@ public class PEPSConnectorServlet extends AuthServlet { try { identityLink = STORKResponseProcessor.connectToSZRGateway(authnResponse.getPersonalAttributeList(), oaParam.getFriendlyName(), - oaParam.getTarget(), + targetType, targetValue, oaParam.getMandateProfiles()); } catch (STORKException e) { // this is really nasty but we work against the system here. We are supposed to get the gender attribute from diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 6d88a1684..20ceb2128 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -144,16 +144,17 @@ public class STORKResponseProcessor { } /** - * Handels connection to SZR-GW and returns Identity Link on success - * @param oaFriendlyName - * @param target - * @param filters - * @param filter - * @param iPersonalAttributeList Received attribute List in assertion + * Handels connection to SZR-GW and returns Identity Link on success. + * + * @param attributeList the attribute list + * @param oaFriendlyName the oa friendly name + * @param targetType the target type + * @param targetValue the target value + * @param filters the filters * @return Identity Link - * @throws STORKException + * @throws STORKException the sTORK exception */ - public static IdentityLink connectToSZRGateway(IPersonalAttributeList attributeList, String oaFriendlyName, String target, String filters) throws STORKException { + public static IdentityLink connectToSZRGateway(IPersonalAttributeList attributeList, String oaFriendlyName, String targetType, String targetValue, String filters) throws STORKException { Logger.trace("Calling SZR Gateway with the following attributes:"); CreateIdentityLinkResponse identityLinkResponse = null; @@ -177,7 +178,7 @@ public class STORKResponseProcessor { String organizationAddress = getAttributeValue("canonicalRegisteredAddress", attributeList); String organizationType = getAttributeValue("translateableType", attributeList); - identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(citizenSignature, representative, represented, mandate, organizationAddress, organizationType, target, oaFriendlyName, filters); + identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(citizenSignature, representative, represented, mandate, organizationAddress, organizationType, targetType, targetValue, oaFriendlyName, filters); } else { // if we get here, we have a natural person representing another natural person String eIdentifier = getAttributeValue("eIdentifier", attributeList); @@ -192,7 +193,7 @@ public class STORKResponseProcessor { identityLinkResponse = AuthenticationServer.getInstance().getIdentityLink(eIdentifier, givenName, lastName, dateOfBirth, gender, citizenSignature, representative, - represented, mandate, target, oaFriendlyName, filters); + represented, mandate, targetType, targetValue, oaFriendlyName, filters); } } else { // we do not have a representation case -- cgit v1.2.3 From 2ee0d4beb3b23613b1bdaa3f9c58723d30303b79 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Fri, 31 Jan 2014 14:39:04 +0100 Subject: fixed saml post binding template location --- .../main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 94cab53d4..209743f45 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1986,7 +1986,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { Logger.trace("Initialize VelocityEngine..."); VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine(); - Template template = velocityEngine.getTemplate("/saml2-post-binding-moa.vm"); + Template template = velocityEngine.getTemplate("/resources/templates/saml2-post-binding-moa.vm"); VelocityContext context = new VelocityContext(); context.put("SAMLRequest", PEPSUtil.encodeSAMLToken(authnRequest.getTokenSaml())); context.put("action", destination); -- cgit v1.2.3 From 9122bf6862fe34881e5454f54c69692b7f5ed083 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Fri, 31 Jan 2014 16:21:13 +0100 Subject: fixed outgoing signrequest - mostly tested --- .../moa/id/auth/AuthenticationServer.java | 40 +++++++++++++---- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 52 +++++++++++++++++----- .../moa/id/auth/stork/STORKResponseProcessor.java | 51 --------------------- 3 files changed, 73 insertions(+), 70 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 209743f45..146137a2c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -31,6 +31,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; +import java.math.BigInteger; import java.security.NoSuchAlgorithmException; import java.security.Principal; import java.security.cert.CertificateException; @@ -49,6 +50,7 @@ import javax.servlet.http.HttpSession; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringEscapeUtils; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; @@ -123,7 +125,6 @@ import at.gv.egovernment.moa.id.storage.DBExceptionStoreImpl; import at.gv.egovernment.moa.id.util.HTTPUtils; import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; import at.gv.egovernment.moa.id.util.Random; -import at.gv.egovernment.moa.id.util.SSLUtils; import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.id.util.client.mis.simple.MISMandate; import at.gv.egovernment.moa.logging.LogMsg; @@ -142,10 +143,14 @@ import at.gv.util.xsd.srzgw.CreateIdentityLinkRequest.PEPSData; import at.gv.util.xsd.srzgw.CreateIdentityLinkResponse; import at.gv.util.xsd.srzgw.MISType; import at.gv.util.xsd.srzgw.MISType.Filters; +import eu.stork.oasisdss.api.AdditionalProfiles; import eu.stork.oasisdss.api.ApiUtils; import eu.stork.oasisdss.api.ApiUtilsException; +import eu.stork.oasisdss.api.Profiles; +import eu.stork.oasisdss.api.QualityLevels; +import eu.stork.oasisdss.api.SignatureTypes; +import eu.stork.oasisdss.profile.AnyType; import eu.stork.oasisdss.profile.DocumentType; -import eu.stork.oasisdss.profile.InputDocuments; import eu.stork.oasisdss.profile.SignRequest; import eu.stork.peps.auth.commons.PEPSUtil; import eu.stork.peps.auth.commons.PersonalAttribute; @@ -1912,7 +1917,9 @@ public class AuthenticationServer implements MOAIDAuthConstants { PersonalAttribute newAttribute = new PersonalAttribute(); newAttribute.setName("signedDoc"); List value = new ArrayList(); - value.add(generateDssSignRequest(CreateXMLSignatureRequestBuilder.buildForeignIDTextToBeSigned("wie im Signaturzertifikat (as in my signature certificate)", oaParam, moasession), "application/xhtml+xml")); + value.add(generateDssSignRequest(CreateXMLSignatureRequestBuilder.buildForeignIDTextToBeSigned("wie im Signaturzertifikat (as in my signature certificate)", oaParam, moasession), + "application/xhtml+xml", + moasession.getCcc())); newAttribute.setValue(value); attributeList.add(newAttribute); @@ -2004,20 +2011,37 @@ public class AuthenticationServer implements MOAIDAuthConstants { Logger.info("STORK AuthnRequest successfully successfully prepared for client with target location: " + authnRequest.getDestination()); } - private static String generateDssSignRequest(String text, String mimeType) { + private static String generateDssSignRequest(String text, String mimeType, String citizenCountry) { IdentifierGenerator idGenerator; try { idGenerator = new SecureRandomIdentifierGenerator(); DocumentType doc = new DocumentType(); - doc.setBase64XML(Base64.encodeBytes(text.getBytes()).getBytes()); + doc.setBase64XML(text.getBytes()); + doc.setID(idGenerator.generateIdentifier()); SignRequest request = new SignRequest(); request.setInputDocuments(ApiUtils.createInputDocuments(doc)); - request.setRequestID(idGenerator.generateIdentifier()); + String id = idGenerator.generateIdentifier(); + request.setRequestID(id); + request.setDocUI(id); - return ApiUtils.marshalToDocument(request).getTextContent(); + request.setProfile(Profiles.XADES_BES.toString()); + request.setNumberOfSigners(BigInteger.ONE); + request.setTargetCountry(citizenCountry); + + // no, no todo. PEPS will alter this value anyhow. + request.setReturnURL("http://invalid_return"); + + AnyType required = new AnyType(); + required.getAny().add(ApiUtils.createSignatureType(SignatureTypes.XMLSIG_RFC3275.toString())); + required.getAny().add(ApiUtils.createAdditionalProfile(AdditionalProfiles.XADES.toString())); + required.getAny().add(ApiUtils.createQualityRequirements(QualityLevels.QUALITYLEVEL_QUALIFIEDSIG)); + required.getAny().add(ApiUtils.createIncludeObject(doc)); + request.setOptionalInputs(required); + + return IOUtils.toString(ApiUtils.marshalToInputStream(request)); } catch (NoSuchAlgorithmException e) { Logger.error("Cannot generate id", e); throw new RuntimeException(e); @@ -2027,7 +2051,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { } catch (DOMException e) { Logger.error("Could not create SignRequest", e); throw new RuntimeException(e); - } catch (ParserConfigurationException e) { + } catch (IOException e) { Logger.error("Could not create SignRequest", e); throw new RuntimeException(e); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index 9dfce7838..a3c8ebe4d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -1,7 +1,10 @@ package at.gv.egovernment.moa.id.auth.servlet; +import iaik.x509.X509Certificate; import java.io.IOException; +import java.io.InputStream; import java.io.StringWriter; +import java.net.URL; import java.util.ArrayList; import java.util.List; @@ -10,19 +13,19 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; import javax.xml.transform.stream.StreamSource; +import org.apache.commons.io.IOUtils; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; -import org.opensaml.saml2.core.Assertion; import org.opensaml.saml2.core.StatusCode; -import org.w3c.dom.Element; import at.gv.egovernment.moa.id.auth.AuthenticationServer; import at.gv.egovernment.moa.id.auth.builder.DataURLBuilder; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; -import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute; import at.gv.egovernment.moa.id.auth.data.IdentityLink; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; @@ -33,14 +36,14 @@ import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.ModulUtils; -import at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParser; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; import at.gv.egovernment.moa.id.util.HTTPUtils; import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.DOMUtils; import at.gv.egovernment.moa.util.StringUtils; +import at.gv.util.xsd.xmldsig.SignatureType; +import at.gv.util.xsd.xmldsig.X509DataType; import eu.stork.oasisdss.api.ApiUtils; -import eu.stork.oasisdss.api.LightweightSourceResolver; +import eu.stork.oasisdss.profile.DocumentWithSignature; import eu.stork.oasisdss.profile.SignResponse; import eu.stork.peps.auth.commons.PEPSUtil; import eu.stork.peps.auth.commons.PersonalAttribute; @@ -173,14 +176,41 @@ public class PEPSConnectorServlet extends AuthServlet { //extract signed doc element and citizen signature String citizenSignature = null; try { - citizenSignature = authnResponse.getPersonalAttributeList().get("signedDoc").getValue().get(0); + String signatureInfo = authnResponse.getPersonalAttributeList().get("signedDoc").getValue().get(0); + SignResponse dssSignResponse = (SignResponse) ApiUtils.unmarshal(new StreamSource(new java.io.StringReader(signatureInfo))); + + List doclocations = ApiUtils.findNamedElement(dssSignResponse.getOptionalOutputs(), DocumentWithSignature.class.getSimpleName(), DocumentWithSignature.class); + // TODO handle multiple docs? + Logger.debug("trying first doclocation"); + String docUrl = doclocations.get(0).getDocument().getDocumentURL(); + Logger.debug("trying first doclocation successful"); + + // fetch signed doc + URL url = new URL(docUrl); + InputStream incomming = url.openStream(); + citizenSignature = IOUtils.toString(incomming); + incomming.close(); + + JAXBContext ctx = JAXBContext.newInstance(SignatureType.class.getPackage().getName()); + SignatureType root = ((JAXBElement) ctx.createUnmarshaller().unmarshal(IOUtils.toInputStream(citizenSignature))).getValue(); + + // memorize signature into authblock moaSession.setAuthBlock(citizenSignature); + + // extract certificate + for(Object current : root.getKeyInfo().getContent()) + if(((JAXBElement) current).getValue() instanceof X509DataType) { + for(Object currentX509Data : ((JAXBElement) current).getValue().getX509IssuerSerialOrX509SKIOrX509SubjectName()) { + JAXBElement casted = ((JAXBElement) currentX509Data); + if(casted.getName().getLocalPart().equals("X509Certificate")) { + moaSession.setSignerCertificate(new X509Certificate(((String)casted.getValue()).getBytes())); + break; + } + } + } - // FIXME untested - Element sepp = (Element) ApiUtils.unmarshal(new StreamSource(new java.io.StringReader(citizenSignature))); - moaSession.setSignerCertificate(AuthenticationServer.getCertificateFromXML(sepp)); - } catch (Exception e) { + } catch (Throwable e) { Logger.error("Could not extract citizen signature from C-PEPS", e); throw new MOAIDException("stork.09", null); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 20ceb2128..2534110d5 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -57,57 +57,6 @@ public class STORKResponseProcessor { /** OASIS DSS Success Message */ public static final String OASIS_DSS_SUCCESS_MSG = "urn:oasis:names:tc:dss:1.0:resultmajor:Success"; - /** - * Extracts the signature value out of a DSS response - * @param signatureResponse DSS signature response - * @return signature - * @throws STORKException - */ - private static Element getSignature(Element signatureResponse) throws STORKException { - - NodeList nList = signatureResponse.getElementsByTagNameNS(OASIS_DSS_NS, "ResultMajor"); - - String resultMajor = XMLUtil.getFirstTextValueFromNodeList(nList); - - if (StringUtils.isEmpty(resultMajor)) { - String msg = "DSS response not correct, ResultMajor element missing."; - Logger.error(msg); - throw new STORKException(msg); - } - - Logger.trace("ResultMajor of DSS response: " + resultMajor); - - if (!OASIS_DSS_SUCCESS_MSG.equals(resultMajor)) { - String msg = "DSS response not correct, ResultMajor is " + resultMajor; - Logger.error(msg); - throw new STORKException(msg); - } - - NodeList nList2 = signatureResponse.getElementsByTagNameNS(OASIS_DSS_NS, "Base64Signature");; - - String base64SigString = XMLUtil.getFirstTextValueFromNodeList(nList2); - - if (StringUtils.isEmpty(base64SigString)) { - String msg = "DSS response not correct, Base64Signature element missing."; - Logger.error(msg); - throw new STORKException(msg); - } - - Logger.trace("Base64Signature element of DSS response: " + base64SigString); - - String sigString = new String(Base64.decode(base64SigString)); - - try { - return XMLUtil.stringToDOM(sigString); - } catch (Exception e) { - String msg = "Unable to extract signature from DSS response"; - Logger.error(msg); - throw new STORKException(msg); - } - - - } - /** * Checks for attribute. * -- cgit v1.2.3 From c2ccb7f48188b369c34cf2116b593a6d7c46b1ac Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Fri, 31 Jan 2014 16:29:15 +0100 Subject: refactored gender retrieval --- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 52 ++++++++++------------ .../moa/id/auth/stork/STORKResponseProcessor.java | 3 +- 2 files changed, 26 insertions(+), 29 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index a3c8ebe4d..b1829439a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -167,6 +167,30 @@ public class PEPSConnectorServlet extends AuthServlet { gender.setValue(tmp); authnResponse.getPersonalAttributeList().add(gender); + } else { + // this is really nasty but we work against the system here. We are supposed to get the gender attribute from + // stork. If we do not, we cannot register the person in the ERnP - we have to have the + // gender for the represented person. So here comes the dirty hack. + try { + Logger.trace("Initialize VelocityEngine..."); + + VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine(); + Template template = velocityEngine.getTemplate("/resources/templates/fetchGender.html"); + VelocityContext context = new VelocityContext(); + context.put("SAMLResponse", request.getParameter("SAMLResponse")); + context.put("action", request.getRequestURL()); + + StringWriter writer = new StringWriter(); + template.merge(context, writer); + + response.getOutputStream().write(writer.toString().getBytes()); + } catch (Exception e1) { + Logger.error("Error sending gender retrival form.", e1); + httpSession.invalidate(); + throw new MOAIDException("stork.10", null); + } + + return; } } @@ -256,34 +280,6 @@ public class PEPSConnectorServlet extends AuthServlet { targetType, targetValue, oaParam.getMandateProfiles()); } catch (STORKException e) { - // this is really nasty but we work against the system here. We are supposed to get the gender attribute from - // stork. If we do not, we cannot register the person in the ERnP - we have to have the - // gender for the represented person. So here comes the dirty hack. - if(e.getMessage().equals("gender not found in response")) { - // fetch gender - - try { - Logger.trace("Initialize VelocityEngine..."); - - VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine(); - Template template = velocityEngine.getTemplate("/resources/templates/fetchGender.html"); - VelocityContext context = new VelocityContext(); - context.put("SAMLResponse", request.getParameter("SAMLResponse")); - context.put("action", request.getRequestURL()); - - StringWriter writer = new StringWriter(); - template.merge(context, writer); - -// response.setContentType("text/html"); - response.getOutputStream().write(writer.toString().getBytes()); - } catch (Exception e1) { - Logger.error("Error sending gender retrival form.", e1); - httpSession.invalidate(); - throw new MOAIDException("stork.10", null); - } - - return; - } Logger.error("Error connecting SZR Gateway", e); throw new MOAIDException("stork.10", null); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java index 2534110d5..344e842b2 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/stork/STORKResponseProcessor.java @@ -136,7 +136,8 @@ public class STORKResponseProcessor { String dateOfBirth = getAttributeValue("dateOfBirth", attributeList); // gender attribute is mandatory here because of some legal stuff -// String gender = getAttributeValue("gender", attributeList); + String gender = getAttributeValue("gender", attributeList); + if (!StringUtils.isEmpty(dateOfBirth)) dateOfBirth = DateTimeUtils.formatPEPSDateToMOADate(dateOfBirth); -- cgit v1.2.3 From 3c1884ee275350e7b2a78256342d9610b1766898 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Fri, 31 Jan 2014 16:31:50 +0100 Subject: remove testing Citizen Country Code from auth flow --- .../main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index 146137a2c..67824bb44 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -1953,8 +1953,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { authnRequest.setEIDCrossSectorShare(true); authnRequest.setEIDSectorShare(true); - authnRequest.setCitizenCountryCode("LOCAL"); -// authnRequest.setCitizenCountryCode(moasession.getCcc()); + authnRequest.setCitizenCountryCode(moasession.getCcc()); Logger.debug("STORK AuthnRequest succesfully assembled."); -- cgit v1.2.3